parapetai-agent
In-process governance for AI agent frameworks. Wrap the agent you already have, and every model call and tool call becomes a Cedar policy decision — default-deny, fail-closed, content-free audit.
pip install parapetai-agent
Use it
from parapetai_agent import GovernedAgent as Agent, GovernanceDenied
agent = Agent(
name="support",
instructions="Help the customer.",
tools=[lookup_order],
agent_id="pa-e3931c464751",
control_plane_url="https://parapetai.example.com",
agent_secret="...",
)
try:
result = await agent.run("Where is order 1234?")
except GovernanceDenied as denied:
print(denied.reason)
GovernedAgent is a drop-in replacement for agent_framework.Agent. If you
build your own middleware chain instead, build_middleware() returns the same
governance as a plain middleware you can pass to middleware=[...].
Policy comes from a signed bundle the SDK pulls from the control plane and
caches locally; decisions are pushed back as content-free audit records.
Without a control plane, point policy_dir= at local Cedar files.
Identity
Governance decisions are made about a caller, not just an agent. Bind one:
from parapetai_agent import set_identity, use_identity
set_identity("alice", claims={"oid": "..."}, roles=["OrderViewer"])
with use_identity("alice"):
await agent.run(...)
In a web app, install parapetai-agent[web] and add IdentityMiddleware, which
lifts the identity off the incoming request instead.
Extras
| Extra | Brings in | For |
|---|---|---|
maf |
agent-framework, mcp, OpenTelemetry SDK + OTLP exporter |
Microsoft Agent Framework integration and OTel export |
web |
starlette |
IdentityMiddleware, jwt_bearer_extractor |
| (base) | cedarpy, httpx, cryptography, opentelemetry-api |
Cedar engine, control-plane protocol, Ed25519 PEP identity |
The base install never imports a web framework or an agent framework, so a CLI script or background worker can depend on it without pulling either in.
Invariants
These are security properties, not defaults you can tune away:
- Fail closed. An unparsed payload, an evaluation error, or a missing policy denies. No exception path becomes an implicit allow.
- Cedar is default-deny. No matching
permitis a Deny;forbidalways beatspermit. - A bad bundle never empties the policy set. Reload keeps the previous policies on failure.
- Prompt content is never logged unless you explicitly opt in. The decision audit record is content-free by construction, not by configuration.
Links
- Source: https://github.com/autonomyproof/parapetai-platform
- Issues: https://github.com/autonomyproof/parapetai-platform/issues
MIT licensed.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parapetai_agent-0.1.0.tar.gz.
File metadata
- Download URL: parapetai_agent-0.1.0.tar.gz
- Upload date:
- Size: 111.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b68c6f8ebf150657bc39f2734649764981d05b33327f97d8cedca6f2ccb954d
|
|
| MD5 |
4af77412c2ad8e325699250569b5cc55
|
|
| BLAKE2b-256 |
5110b061bdaefda62b5895b2a1857ec1d94f9f621096d0995fd014072e0c3f57
|
File details
Details for the file parapetai_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: parapetai_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 84.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc47a50542c5a47af7de7cae0ab4374d764699f5991dd9381f4943df9ba3d331
|
|
| MD5 |
a2df0329b10d39d3b8889c5ebfe3cbf9
|
|
| BLAKE2b-256 |
f832f7544e1b7deccea97f07b3a642c83a1a2df6e1ae9280d8680deeec7361db
|