Guardrail and evaluation framework for business-process AI agents — governs and tests action safety, not just output quality.
Project description
Warden
Guardrails and evaluation for AI agents that take real actions against real systems — not chatbots that only produce text.
Existing LLM eval tools (promptfoo, deepeval, langsmith) score output quality. Warden governs and tests action safety — what an agent is about to do to a system of record (ERP, accounting, email, internal APIs), before it does it, with a tamper-evident audit trail afterwards.
Naming: working name is
warden; published aswarden-guardon PyPI (the bare name was taken). Import path staysimport warden.
The problem
An agent wired to your ERP is one hallucinated tool call away from deleting last quarter's invoices or emailing a customer the wrong balance. You can't unit-test that with a prompt-quality scorer. Warden puts a gateway between the agent and the system: every proposed action is validated, risk-classified, checked against policy, optionally routed to a human, and logged — then allowed, blocked, sanitized, or held.
The single architectural idea: the agent never touches the target system directly. Everything routes through the gateway. Guardrails (runtime) and eval (offline) share the same ProposedAction model and the same policy engine — so the guarantees you demo in production are the same ones your CI suite proves.
Quickstart (30 seconds)
pip install -e ".[dev]"
from warden import Operation
from warden.gateway import Gateway, guard
from warden.policy import load_policies, PolicyEngine
engine = PolicyEngine(load_policies("policies/builtin.yaml"))
gateway = Gateway(engine)
@guard(gateway, tool_name="odoo.create_invoice", target="odoo-prod",
operation=Operation.CREATE, agent_id="billing-bot")
def create_invoice(**payload):
... # only ever called on ALLOW
# A DELETE against prod with no explicit ALLOW policy is escalated/blocked,
# never silently executed.
Run the eval suite (CI-gating):
warden eval scenarios/
warden audit verify
Core principles
- Fail-closed. Validation error, engine exception, approver timeout, audit-write failure → BLOCK. No code path allows an uncertain action.
- Default-deny for destructive ops.
DELETE/EXTERNAL_SEND/EXECUTEneed an explicit ALLOW or they escalate to human approval. - The audit log is the spine. Every action that reaches the gateway produces exactly one hash-chained audit record — including blocked and errored ones.
- Eval can never cause real side effects. Eval mode is hard-isolated from production connectors.
- Policies are data, the engine is code. Add rules in YAML or Python without touching the engine.
- Secrets never enter policies, logs, or audit records. Redaction runs before persistence.
- Idempotent approvals. An approval resolves at most once; replays are rejected.
Architecture
┌──────────────────────────────────────────────┐
Agent (LLM + tools) │ WARDEN │
│ │
"create invoice" ───► │ Gateway.check(ProposedAction) │
│ │ │
│ ▼ │
│ Decision Pipeline │
│ 1. validate (pydantic) [fail-closed] │
│ 2. classify risk tier │
│ 3. evaluate policies (priority order) │
│ 4. resolve outcome │
│ 5. if REQUIRE_APPROVAL → Approver (await) │
│ 6. write AuditRecord (always) │
│ │ │
│ ▼ │
│ Decision {ALLOW│BLOCK│SANITIZE│...} │
└─────┬────────────────────────────────────────┘
│ ALLOW / sanitized payload
▼
Target system (Odoo, mail, API) ◄── only reached on ALLOW
See docs/architecture.md and docs/security.md.
Status
MVP in progress. See SPEC.md for the full build specification and phasing.
License
Apache-2.0.
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 warden_guard-0.1.0.tar.gz.
File metadata
- Download URL: warden_guard-0.1.0.tar.gz
- Upload date:
- Size: 50.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b360107cde05e3c824e3c2571ee362023b71b64f441fe47475ea06b6d62f950d
|
|
| MD5 |
ec64dac5f54cdeaaaa0be2d9877fbc56
|
|
| BLAKE2b-256 |
a6ce3a8fefea12ea3152803edc2afe9b178f6fdaeea205267b8ba68f2e6c7abd
|
File details
Details for the file warden_guard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: warden_guard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33c609c9cc0e74a29114f797d6f3064f7b32c143d855f6d1f37480e4d2959921
|
|
| MD5 |
550c6b45c209279a3df0b26555ab208f
|
|
| BLAKE2b-256 |
5369043864db41801b923dbf3a74672df459990282be0cb735856ca007e1fa4a
|