Xybern
Identity & authorisation infrastructure for AI agents. Install once — Xybern discovers every AI agent in your system, gives each a cryptographic identity, and (when you turn enforcement on) authorises every action before it executes.
pip install xybern
xybern login # browser device-code flow (auto-links your workspace)
from xybern import auto
auto.connect() # discovers frameworks + agents + tools, registers them, instruments them
✓ Detected frameworks: CrewAI, LangGraph, 2 MCP servers
✓ Found 12 agents · 48 tools
✓ Registered to workspace "Acme Corp" (each issued a cryptographic identity)
✓ Mode: OBSERVE — actions logged, nothing blocked yet
Where to add it
Add these two lines once, at your app's startup — before your agents run. That's the whole integration.
from xybern import auto
auto.connect()
# ... then your normal code: build agents, run the crew/graph, serve, etc.
| Your setup | Where to put it |
|---|---|
| Agent script (CrewAI / LangChain / OpenAI Agents / LlamaIndex) | Top of your main file, before creating agents |
| FastAPI | Right after app = FastAPI() |
| Celery | In the Celery app module (runs in each worker) |
| MCP server | Top of the server entry, before serving tools |
| Django | An AppConfig.ready() or wsgi.py |
| Jupyter | First cell |
Multi-process (gunicorn / multiple Celery workers): run it in the module each worker imports, so every process is covered.
What it does
- Auto-discovery — detects and instruments LangChain, CrewAI, OpenAI Agents SDK, MCP servers, LangGraph, AutoGen, Semantic Kernel, LlamaIndex (and FastAPI/Celery). No manual wiring; agents appear in your Xybern dashboard as your app creates them.
- Cryptographic identity — every discovered agent is registered and issued an identity, so its actions are attributable and signable.
- Authorisation before execution — each tool/agent action passes through Xybern's
policy engine;
allow/block/escalate. - Observe-first & fail-open — default mode only logs (never blocks). When you switch to enforce, the SDK fails open if Xybern is unreachable, so it can't take your agents down.
- Privacy — sends content hashes by default, not raw payloads.
Modes
auto.connect() # OBSERVE (default): log + inventory, never blocks
auto.connect(mode="enforce") # authorise actions (allow/block/escalate)
or persist it: xybern enforce on / xybern enforce off.
CLI
xybern login [--api-key xb_...] # device-code flow, or paste a key / set XYBERN_API_KEY
xybern agents # dry-run: what would be discovered
xybern doctor # per-framework enforcement coverage
xybern status
xybern enforce on|off
xybern run --agent NAME python your_agent.py # authorise a program without editing it
xybern logout
xybern run, no code change
xybern run --agent soc-agent python agent.py "Investigate alert ALR-1042"
Runs the program in this interpreter with auto.connect() already applied, so the
file itself is untouched. --agent gives the whole process one identity: it is
registered once, its tools are its capabilities, and every tool call is attributed
to it. --enforce / --observe set the mode for this run, --wait SECONDS
(default 900) is how long an escalated action is held for a person's decision,
--frameworks langchain,mcp limits the hooks.
The same in code: auto.connect(agent="soc-agent", escalation_wait=900).
Auth options
- Device code —
xybern loginopens a browser; approve + pick a workspace; a scoped key is minted and stored in~/.xybern/credentials.json. - API key —
xybern login --api-key xb_..., orexport XYBERN_API_KEY=xb_..., orauto.connect(api_key="xb_...").
Configuration
| Option | Default | Meaning |
|---|---|---|
mode |
observe |
observe (log only) or enforce (act on decisions) |
fail_open |
True in observe, False in enforce |
allow actions through if Xybern is unreachable (enforce mode) |
redact |
False |
send only a SHA-256 of the content (XYBERN_REDACT=1). Content-pattern and semantic mandates cannot evaluate hashed content; for residency use a relay or dedicated deployment instead |
frameworks |
all | restrict to specific frameworks (XYBERN_FRAMEWORKS=langchain,mcp) |
agent |
none | one identity for the whole process; every tool call is attributed to it (XYBERN_AGENT) |
escalation_wait |
0 |
enforce mode: seconds to hold an escalated action for a person's decision; 0 refuses it at once (XYBERN_ESCALATION_WAIT) |
In enforce mode a refused action raises PolicyBlocked with the decision's reasoning,
a held one PolicyEscalated (or ApprovalRejected after a person rejects it), and a
terminated session SessionTerminated.
Metadata
Release files for xybern 2.22.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xybern-2.22.0.tar.gz | 74.0 kB | Without provenance | Details for xybern-2.22.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xybern-2.22.0-py3-none-any.whl | Python 3 | none | any | Details for xybern-2.22.0-py3-none-any.whl |
Total release size: 151.1 kB
Release files / xybern-2.22.0.tar.gz
| Download URL | xybern-2.22.0.tar.gz |
|---|---|
| Size | 74.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5f6dddd5478d383c9832cc5302ded13dd7bfe350ab5e8d88b9382873ac8b701
|
|
BLAKE2b-256 checksum How to use checksums |
52a6d87011bbc27ca190bec3c46b9cf1af454ae3b4390df5053eadbd19f88e2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / xybern-2.22.0-py3-none-any.whl
| Download URL | xybern-2.22.0-py3-none-any.whl |
|---|---|
| Size | 77.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8ae2bfe85e3ae264698075576c63e5dad261d71c06e03e2d6aaec8cf6cf04f4
|
|
BLAKE2b-256 checksum How to use checksums |
1e7b20558009c6ff9936f1a6238783781da6b50948c3c5edbf31f18c8c52dcd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for xybern 2.22.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.