Skip to main content

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 permit is a Deny; forbid always beats permit.
  • 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

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

parapetai_agent-0.1.1.tar.gz (128.0 kB view details)

Uploaded Source

Built Distribution

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

parapetai_agent-0.1.1-py3-none-any.whl (96.7 kB view details)

Uploaded Python 3

File details

Details for the file parapetai_agent-0.1.1.tar.gz.

File metadata

  • Download URL: parapetai_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 128.0 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

Hashes for parapetai_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 17093a6699fc402f17e3619278a3482c0a4939c8e42f02079b49203924e4ef33
MD5 6a4d43aa3cebe3668d0484f31bbb9440
BLAKE2b-256 be29b0aab18f8f52d663c1e603df0a2973da1a67629d8fc897b4792359a5fa64

See more details on using hashes here.

File details

Details for the file parapetai_agent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: parapetai_agent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 96.7 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

Hashes for parapetai_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4c3189a960932d9a2e58f64853892b96dce8a9c3526b0a84c6ed8d8263d4937
MD5 654bc0541f2d154475da167e91c5312a
BLAKE2b-256 c8a094a778226bb64b19ffb5c3717f36774bb0ef9ffa4599df0cd7b884e9514c

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 Sentry Error logging StatusPage Status page