EU AI Act Articles 12 & 14 · Bilateral Receipts

What agents can do.What agents did do.

Gate is a pre-execution policy engine with bilateral receipts. Covenants declare what's allowed. Ed25519 signatures prove what happened. Every action is authorized, executed, sealed, and chained into a tamper-evident audit trail.

Try the Live Demo View on GitHub
Architecture

Five steps. Every action covered.

Gate sits between your agent and the actions it takes. Nothing executes without a covenant check, a signed authorization, and a sealed result.

1

Covenant

YAML policy declares permit, forbid, and require_approval rules before the agent runs.

2

Authorize

Agent requests an action. Gate evaluates the covenant and signs an authorization receipt.

3

Execute

If authorized, the action runs. If require_approval, a human callback decides first.

4

Seal

Execution result is hashed and sealed into the receipt with a second Ed25519 signature.

5

Chain

The sealed receipt is chained into the HMAC-SHA256 audit trail. Tamper-evident from here.

Policy as code. Before anything runs.

A covenant is a YAML file that declares exactly what an agent is allowed to do. Three rule types: permit, forbid, and require_approval. Add conditions with when and unless clauses.

The covenant is SHA-256 hashed, and that hash is embedded in every receipt. Change a single rule, and every subsequent receipt carries a different covenant hash. An auditor can verify exactly which policy was active for any action.

Article 9 - Risk Management
browser-agent.covenant.yaml
agent: browser-agent
version: "1.0"

rules:
  # Navigation - always permitted
  - permit: navigate
  - permit: scroll
  - permit: read_page

  # Forms - human must approve
  - require_approval: fill_form
  - require_approval: submit_form
  - require_approval: purchase
    when: "amount > 0"

  # Dangerous - always blocked
  - forbid: download_executable
  - forbid: install_extension
  - forbid: grant_permissions
Bilateral Receipt PHASE 1: AUTH PHASE 2: SEAL
receipt_id: a7f3c...
agent_id: loan-processor
action: approve_loan
covenant_hash: 26c5b0cc...
payload_hash: sha256:9f8e1d...
decision: require_approval
authorized: true (human approved)

--- Phase 1: Authorization ---
auth_sig: ed25519:3a8f7b2c...
created_at: 2026-04-19T23:42:01Z

--- Phase 2: Seal ---
result_hash: sha256:b4d2e7...
result_status: success
seal_sig: ed25519:7c1d9e4a...
sealed_at: 2026-04-19T23:42:01Z

--- Audit Chain ---
chain_hash: hmac-sha256:f2a1...

Two phases. One tamper-proof record.

Phase 1 (Authorization): Gate checks the covenant, makes a decision, and signs the authorization with Ed25519. The payload is SHA-256 hashed - raw data never enters the receipt.

Phase 2 (Seal): After execution, the result is hashed and sealed into the same receipt with a second signature. The seal covers the authorization signature, so the entire lifecycle is cryptographically bound.

A third party can verify any receipt with just the public key. No shared secret needed. Non-repudiation built in.

Article 12 - Record-Keeping
Code

10 lines to gate any agent

Load a covenant. Authorize actions. Seal results. Verify receipts. All in standard Python.

gate_example.py
from air_blackbox.gate import Gate, Covenant

# Load policy
covenant = Covenant.from_yaml("covenant.yaml")
gate = Gate(covenant=covenant)

# Phase 1: Authorize the action
receipt = gate.authorize(
  agent_id="loan-processor",
  action_name="approve_loan",
  payload={"applicant": "[email protected]", "amount": 75000},
  context={"amount": 75000},
)

if receipt.authorized:
  result = process_loan(...)

  # Phase 2: Seal the receipt with execution result
  gate.seal(receipt, result=result, status="success")
else:
  print(f"Blocked: {receipt.decision}")

# Verify - third party can do this with just the public key
report = gate.verify(receipt)
print(report["overall"]) # True

Multi-agent traceability

When an orchestrator delegates to a sub-agent, the child's receipt links back to the parent via parent_receipt_id. Walk the chain from any receipt back to the root authorization.

Every receipt in the chain is independently verifiable. If a child agent misbehaves, the delegation chain shows exactly who authorized what, and when.

Article 14 - Human Oversight
delegation.py
# Parent agent gets authorized
parent = gate.authorize(
  "orchestrator", "delegate_task",
  payload={"task": "send confirmation"}
)

# Child links back to parent
child = gate.authorize(
  "notifier-agent", "send_email",
  payload={"to": "[email protected]"},
  parent_receipt=parent,
)

# Walk the full chain
chain = gate.walk_delegation_chain(child)
# [orchestrator, notifier] - root first
Capabilities

What Gate covers

Pre-execution policy, cryptographic proof, human oversight, and audit-ready record-keeping in one library.

🔒

Ed25519 Signatures

Asymmetric signing with Ed25519 for non-repudiation. Third parties verify receipts with just the public key. HMAC-SHA256 fallback when cryptography isn't installed.

Non-Repudiation
⚠️

Covenant DSL

YAML-based policy with permit, forbid, and require_approval rules. Supports conditional logic with when and unless clauses. SHA-256 hashed for integrity.

Article 9
📝

Bilateral Receipts

Two-phase proof: authorization decision + execution result in a single cryptographically bound record. Seal covers auth, auth covers covenant.

Article 12
🔗

HMAC Audit Chains

Every receipt is chained into an HMAC-SHA256 audit trail. Tamper with one record, break every record after it. Cryptographically verifiable integrity.

Article 12
🔔

Human Approval Callbacks

When a covenant rule says require_approval, Gate pauses and calls your callback. Slack, email, CLI prompt - you decide the interface. Decision is signed into the receipt.

Article 14
🛡️

Delegation Chains

Multi-agent workflows produce linked receipt chains. Walk from any child receipt back to the root authorization. Every hop independently verifiable.

Multi-Agent
Get Started

Running in 60 seconds

Install from PyPI. Write a covenant. Gate your first action.

terminal
# Install with Ed25519 support
$ pip install air-blackbox[gate]

# Or without optional crypto (uses HMAC-SHA256 fallback)
$ pip install air-blackbox

# Quick test -58 tests, all passing
$ python test_gate.py
RESULTS: 58 passed, 0 failed out of 58 tests
✓ All tests passed.

# Performance: 9,000+ authorizations/sec, 3,500+ full lifecycles/sec

Declare what's allowed. Prove what happened.

Every AI agent action should be policy-checked, signed, and audit-ready. Gate makes it happen with one import.

pip install air-blackbox[gate] Star on GitHub