agent-gate introduces a structured, fail-closed quality gate for AI agent workflows. By implementing deterministic checks and an independent review process, it guarantees accountability and quality. With tamper-evident receipts documenting decisions, agent-gate transforms how AI agents work, preventing costly silent failures.
Agent-Gate
agent-gate is a server designed to enhance the quality control of AI agent workflows by implementing a fail-closed quality gate combined with a hash-chained receipt ledger. This approach ensures that AI agents can only claim their tasks as "done" after passing mandatory deterministic checks and an independent review process, leaving behind a transparent, tamper-evident audit trail.
Key Features
- Fail-Closed Mechanism: Verifies that all required checks are explicitly satisfied, reducing the risk of silent failures in agent systems. If any proof is missing, the work cannot be declared complete.
- Tamper-Evident Receipts: All decisions, along with relevant metrics and verdicts, are logged into a hash-chained ledger. This guarantees the integrity of the receipts, as any alteration will result in a verification failure.
- Human Oversight by Default: A key feature of the system is the requirement for human approval on irreversible actions, shielding against erroneous claims by the agent.
Usage Example
To verify an agent’s work and track decisions, use the following code snippet:
agent: "done!" -> verify_gate(evidence) -> { passed: false, blocking: ["independent_refute_review", "no_secrets"] }
Available Tools
The repository includes several tools that facilitate interaction with the gate mechanism:
| Tool | Description |
|---|---|
gate_checklist(name="ship") | Retrieves the checklist the agent must complete before declaring completion. |
verify_gate(evidence, name="ship") | Evaluates the evidence provided by the agent in a fail-closed manner, returning the outcome and any blocking issues. |
record_receipt(decision, metric, value, verdict) | Logs a receipt that is hash-chained, ensuring audit trails remain intact. |
read_receipts() | Retrieves all records from the ledger and checks the integrity of the chain. |
The default checklist for the ship gate includes the following checks: deterministic_checks_pass, independent_refute_review, no_secrets, human_gated_if_irreversible, and honest_receipt_logged.
Development and Testing
agent-gate has been rigorously developed using Python's standard library, ensuring reliability and performance. The most recent tests confirm compatibility with Python versions 3.11 through 3.13, reinforcing the framework's stability and efficiency. To maintain code quality, developers can run the provided test suite with:
pip install -e ".[dev]" && python -m pytest -q
Contribution
For those interested in contributing to agent-gate, please refer to the CONTRIBUTING.md file for guidelines and best practices.
No comments yet.
Sign in to be the first to comment.