Policy-as-code runtime for AI agents — audit log + hard-no enforcement.
Project description
AgentGuard (devtrust-agentguard)
Policy-as-code runtime for AI agents — audit log + hard-no enforcement. The Wave 4 governance layer of the DevTrust platform.
Status
v0.0.1 alpha — deterministic policy engine, ContextVar-based agent identity, JSONL audit log, three bundled baseline policies (money-movement, destructive-filesystem, credential-disclosure) plus a composed baseline-starter. CLI for dry-runs.
What ships in v0.0.1:
- Pydantic models —
Policy,Rule,ToolCall,Decision. The on-disk audit-log shape is the same as the in-memory shape; no transformation between them. evaluate(policy, call)— pure function. First-matching-rule-wins. No-match → conservative default-deny.enforce(policy, call, audit=...)— same evaluation, plus appends the Decision as one JSON line to an audit file.with_agent("...")/current_agent()— ContextVar that survives threads and asyncio. Same pattern asagtraceandtokencost.- Three baseline policies — opinionated deterministic defaults covering the OWASP Top-10 categories most expressible without an expression DSL.
- CLI —
agentguard version,agentguard policies,agentguard check.
Why
OWASP published a Top-10 for Agentic Applications in December 2025. 96% of enterprises run AI agents in production; only 12% have a central platform to manage them. AgentGuard is the runtime layer that enforces "this agent can read tickets but cannot send mail," with an auditable trail of every allow / deny / approval-needed decision.
Conservative-by-default is the design choice: anything not explicitly allowed is denied. Easier to loosen than tighten.
CLI
agentguard version
agentguard policies
agentguard check --tool stripe.charge --policy baseline-starter
agentguard check --tool fs.delete --policy destructive-filesystem \
--arguments-json '{"recursive":true}'
Library use
from agentguard import Policy, Rule, ToolCall, evaluate, enforce, with_agent
from agentguard.baseline import baseline_starter_policy
policy = Policy(
name="my-agent",
rules=[
# Allow rules go FIRST — they short-circuit before the deny rules.
Rule(name="allow-read-tickets", effect="allow",
tool="zendesk.read", reason="Read-only access to support tickets."),
# Then compose the conservative defaults:
*baseline_starter_policy().rules,
],
)
with with_agent("support-bot:installation-12345"):
decision = enforce(
policy,
ToolCall(tool="zendesk.read", arguments={"ticket_id": 42}),
audit="audit.jsonl",
)
if decision.status == "allow":
# ... call zendesk.read for real
pass
else:
raise PermissionError(decision.reason)
Roadmap
- v0.1 — YAML / TOML policy file format; OWASP Top-10 detector pack (full); replay-from-audit-log helper that re-runs decisions deterministically.
- v0.2 — approval workflows (Slack / Teams / email round-trips with timeout + retry); shadow-mode (log denials but don't enforce, for the first 30 days of each new policy).
- v0.3 — replay + time-travel debugging via
agtraceintegration; per-agent identity and scoped credentials. - v1.0 — visual policy builder (compliance-team-friendly), red-team integration, cross-agent policies, continuous compliance.
Apache-2.0
See CHANGELOG. Part of the DevTrust monorepo.
Project details
Release history Release notifications | RSS feed
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 devtrust_agentguard-0.0.1.tar.gz.
File metadata
- Download URL: devtrust_agentguard-0.0.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b553498c11c697c7462c8540aeb16c77bb1e9d0fb456ccc50c7a03ae91f8a47
|
|
| MD5 |
f4c59b19df4ff37a17e1740258df0dda
|
|
| BLAKE2b-256 |
cae8e286a74f466a95bb840c45baabd14062d3dc2216c60fcc1921c24bb8baf3
|
Provenance
The following attestation bundles were made for devtrust_agentguard-0.0.1.tar.gz:
Publisher:
release.yml on AbdullahBakir97/DevTrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtrust_agentguard-0.0.1.tar.gz -
Subject digest:
7b553498c11c697c7462c8540aeb16c77bb1e9d0fb456ccc50c7a03ae91f8a47 - Sigstore transparency entry: 1487211656
- Sigstore integration time:
-
Permalink:
AbdullahBakir97/DevTrust@9426cd1e3736ee374994ccdb934fa863c6e50e6a -
Branch / Tag:
refs/tags/devtrust-agentguard-v0.0.1 - Owner: https://github.com/AbdullahBakir97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9426cd1e3736ee374994ccdb934fa863c6e50e6a -
Trigger Event:
push
-
Statement type:
File details
Details for the file devtrust_agentguard-0.0.1-py3-none-any.whl.
File metadata
- Download URL: devtrust_agentguard-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac0d22eb9bf9da0748da9962aea7bd0439a276c01bb62c09057e2749aed49a01
|
|
| MD5 |
ec7d032c59d7e5f5d009928f474c1964
|
|
| BLAKE2b-256 |
c073146a6556b9128f916639b2d13514bc0ce0fb1bd5bdca6431919f96b5b515
|
Provenance
The following attestation bundles were made for devtrust_agentguard-0.0.1-py3-none-any.whl:
Publisher:
release.yml on AbdullahBakir97/DevTrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtrust_agentguard-0.0.1-py3-none-any.whl -
Subject digest:
ac0d22eb9bf9da0748da9962aea7bd0439a276c01bb62c09057e2749aed49a01 - Sigstore transparency entry: 1487211687
- Sigstore integration time:
-
Permalink:
AbdullahBakir97/DevTrust@9426cd1e3736ee374994ccdb934fa863c6e50e6a -
Branch / Tag:
refs/tags/devtrust-agentguard-v0.0.1 - Owner: https://github.com/AbdullahBakir97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9426cd1e3736ee374994ccdb934fa863c6e50e6a -
Trigger Event:
push
-
Statement type: