Skip to main content

Security and identity infrastructure for AI agents

Project description

Cyphrex (Python)

Official SDK for Cyphrex — call check() before every agent action.

Installation

pip install cyphrex

Or from source:

cd packages/sdk-python
pip install -e .

Quick start

import os
from cyphrex import Cyphrex

client = Cyphrex(
    api_key=os.environ["CYPHREX_API_KEY"],
    agent_id="your-agent-uuid",
    # api_url optional; defaults to production API
)

result = client.check(
    action_type="http_call",
    url="https://api.example.com/data",
)

if not result["allowed"]:
    print(result.get("reason"), result.get("violations"))
else:
    # proceed with the action
    pass

Constructor

Argument Required Description
api_key Yes Account API key from Dashboard → API Keys
agent_id Yes UUID of the agent
api_url No API base URL (default: https://cyphrexapi-production.up.railway.app)
timeout No Seconds (default 10)
fail_open No If True, allow actions when Cyphrex is unreachable

Environment variable CYPHREX_API_URL overrides the default base URL when api_url is omitted.

check(action_type, url=None, payload=None, metadata=None)

Returns a dict:

  • allowed (bool)
  • reason (str, optional)
  • violations (list, optional) — e.g. severity codes when blocked
  • severity (str, optional) — P1 / P2 / P3
  • spend (dict, optional) — reserved for future use

For data access, include dataScope in metadata or use check_data_access(scope).

For LLM cost limits, pass estimatedCost in metadata or use check_llm_input(..., estimated_cost=...).

HTTP

POST {api_url}/v1/check with:

  • Authorization: Bearer <api_key>
  • JSON body: {"agentId": "...", "action": {"type": "...", ...}}

License

MIT

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

cyphrex-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

cyphrex-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file cyphrex-0.1.0.tar.gz.

File metadata

  • Download URL: cyphrex-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for cyphrex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 445722aced3fa771654fc7188bcd58c1b00450303277a3ff9d8b1ae0291e6332
MD5 124fe67441a957eba52f34054bf13511
BLAKE2b-256 3839b44d57012dcf2e4a0c5dea134656dc202bd8803dcecc4644e6112d00f352

See more details on using hashes here.

File details

Details for the file cyphrex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cyphrex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for cyphrex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a619c54e69af9f1c8f69f08abeab7dcdfa6c0e5478bc50ce2954e41322e02c7
MD5 da56983ec4f62f02a6b2956916bcdea6
BLAKE2b-256 3f2eeebb89717e70a911380275441290143323395642af2af5aea33d64da2720

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