Skip to main content

Python SDK for the Rakshak LLM security guard API

Project description

rakshak

Python SDK for the Rakshak LLM security guard API.

Install

pip install rakshak

Quick start

import rakshak

client = rakshak.Client(api_key="rsk_...")

# Block malicious input
result = client.guard(user_input)
if result.blocked:
    return "I can't help with that."

# Sanitize LLM output (redacts PII, blocks policy violations)
result = client.sanitize(llm_response)
reply = result.safe_text or "[Response blocked]"

# Multi-turn conversation guard
session = client.conversation("user-session-id")
result = session.send(user_message)
if result.flagged:
    print("Rising risk score:", result.risk_score)

Async

async_client = rakshak.AsyncClient(api_key="rsk_...")
result = await async_client.guard(user_input)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rakshak-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rakshak-0.1.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file rakshak-0.1.2.tar.gz.

File metadata

  • Download URL: rakshak-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for rakshak-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d2a6078efb93356f329735fb1b17ca66af512af2e0a4444f744296e52eae335f
MD5 6266f74966c66608fd8801fd0df18c16
BLAKE2b-256 89e8701c4dfab2a7223bfc3a625d494c3124917ebc9ff5711e07d0a41c8b661b

See more details on using hashes here.

File details

Details for the file rakshak-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rakshak-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for rakshak-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 533daad3ce49c1398fabe41e3a0b1830ef2d413367c23af9e1c4af7082e40f0e
MD5 b1a5bf2932415d9ffaeb680e30894d1f
BLAKE2b-256 a70337432ced2efa1ddc89416aa829f5978a957895c54b5a1872d3d2a0851687

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page