authgate
The DAG framework where every agent action needs a permit before it runs.
pip install authgraph
from authgate import AGEFRuntime
authgraph is the PyPI distribution name; import the package as authgate. It is a Python DAG execution framework where every node transition asks a TrigGuard gateway "is this allowed?" and refuses to proceed without a PERMIT receipt. No permit → no execution. Every action leaves a signed receipt.
Powered by TrigGuard. Requires a TrigGuard gateway (hosted free tier: 5,000 decisions/month, no credit card).
Previously known internally as AGEF (Authority-Governed Execution Framework).
What authgate is
authgate is a DAG-based execution orchestration framework for AI agents. It answers a question that Temporal, Airflow, LangGraph, and CrewAI don't:
Before this agent executes this task — is it actually authorized to?
authgate wraps every claim, every execution, and every completion in a TrigGuard authorization call. The result is a verifiable audit trail of receipts that proves every action was permitted before it happened.
Relationship to TrigGuard
┌─────────────────────────────────────────────────┐
│ authgate │
│ DAG engine · Coordinator · Verification │
│ │
│ AuthorityGate (gate.py) │
│ ↓ authorize(surface, actor, context) ↓ │
└──────────────────┬──────────────────────────────┘
│ public SDK only
▼
┌─────────────────────────────────────────────────┐
│ TrigGuard │
│ Authorization · Receipts · Policy │
└─────────────────────────────────────────────────┘
authgate is a consumer of TrigGuard. It calls TrigGuard's public authorize() SDK method and stores the returned receipt IDs as references. authgate never:
- Imports TrigGuard internals
- Mints or signs receipts
- Bypasses the authority boundary
- Modifies TrigGuard policy
The AuthorityGate class (gate.py) is the only file in authgate that touches TrigGuard. Every other module is framework-neutral.
Architecture
authgateRuntime
├── ExecutionGraphEngine DAG validation, Kahn's topological sort, state machine
├── AuthorityGate Single TrigGuard integration point
├── Coordinator Claim leases, TTL, duplicate suppression
├── VerificationEngine Evidence checks, hallucination detection
└── OutcomeTracker Drift scoring, policy flywheel data
Node lifecycle
PENDING → READY → CLAIMED → EXECUTING → VERIFYING → COMPLETE
↘ FAILED → READY (retry)
Every PENDING → CLAIMED and VERIFYING → COMPLETE transition requires a TrigGuard PERMIT.
TrigGuard surfaces
| Surface | When |
|---|---|
planning.task.create |
Before READY → CLAIMED |
artifact.publish |
Before VERIFYING → COMPLETE |
execution.external_action |
Before releasing downstream external-effect nodes |
Quick start
import os
from authgate import authgateRuntime, EvidenceArtifact, VerificationTier
import hashlib
# Set your TrigGuard API key
os.environ["TRIGGUARD_API_KEY"] = "your-key"
runtime = authgateRuntime()
graph = runtime.create_graph(title="Deploy workflow", description="Plan → Build → Release")
plan = runtime.add_node(graph, title="Plan", description="Define scope")
build = runtime.add_node(graph, title="Build", description="Implement",
verification_tier=VerificationTier.HIGH)
release = runtime.add_node(graph, title="Release", description="Publish",
authority_surface="artifact.publish",
verification_tier=VerificationTier.CRITICAL)
runtime.add_dependency(graph, from_node=plan, to_node=build, transfer_outputs=["spec"])
runtime.add_dependency(graph, from_node=build, to_node=release, transfer_outputs=["artifact"])
runtime.start(graph)
# Claim and execute each node
for node in [plan, build, release]:
claim = runtime.attempt_claim(graph, node, agent_id="my-agent")
runtime.execute_node(graph, node, claim_token=claim["claim_token"])
content = f"work done on {node.title}"
h = hashlib.sha256(content.encode()).hexdigest()
runtime.submit_completion(
graph, node,
claim_token=claim["claim_token"],
outputs={"result": f"{node.title} complete"},
evidence=[EvidenceArtifact(
artifact_id=f"ev-{h[:8]}", artifact_type="TEXT",
content_hash=h, content_ref=content, produced_by="my-agent",
)],
)
print(graph.status) # COMPLETE
CrewAI example
from authgate import authgateRuntime, VerificationTier
runtime = authgateRuntime()
graph = runtime.create_graph(title="Research crew", description="Authority-governed research")
research = runtime.add_node(graph, title="Research", description="Market analysis")
report = runtime.add_node(graph, title="Report", description="Publish findings",
authority_surface="artifact.publish")
runtime.add_dependency(graph, from_node=research, to_node=report)
runtime.start(graph)
# Wrap each CrewAI task execution with attempt_claim / execute_node / submit_completion
# TrigGuard receipt is stored on node.complete_authority_receipt_id
See examples/crewai_example.py for the full pattern.
LangGraph example
bridge = authgateLangGraphBridge()
bridge.register_node("planner", "Generate plan")
bridge.register_node("executor", "Execute plan", depends_on=["planner"])
bridge.start()
@bridge.guarded_node("planner")
def planner_node(state):
return {**state, "plan": "do the thing"}
Each @bridge.guarded_node decorator wraps the LangGraph node function in an authgate authority gate. The TrigGuard receipt is stored in the LangGraph state under agef_receipts.
See examples/langgraph_example.py for the full pattern.
Quanta example
bridge = QuantaauthgateBridge()
graph = bridge.mission_to_graph(quanta_mission)
result = bridge.run_task(graph, "Engineering Build", eng_agent,
outputs={"artifact": "v2.tar.gz"},
work_summary="Build complete")
Quanta creates missions; authgate executes them with authority gates. Quanta is a consumer of authgate — any other orchestrator can replace it.
See examples/quanta_example.py for the full pattern.
Authorization example
# gate.py handles all authorization — nothing else in authgate touches TrigGuard
from authgate import AuthorityGate
gate = AuthorityGate() # reads TRIGGUARD_API_KEY from environment
decision = gate.authorize_claim(
node_id="node-abc",
graph_id="graph-xyz",
agent_id="my-agent",
surface="planning.task.create",
context={"title": "Research task"},
)
if decision.permitted:
print(f"PERMIT — receipt: {decision.receipt_id}")
else:
print(f"DENIED — {decision.reason}") # fail-closed
If TrigGuard is unreachable, permitted is False and the node stays READY. Nothing proceeds without a receipt.
Outcome tracking example
from authgate import OutcomeTracker, OutcomeClassification
tracker = OutcomeTracker()
tracker.record(
node,
execution_summary="Agent completed research on schedule",
classification=OutcomeClassification.CORRECT,
execution_drift_score=0.05,
outcome_drift_score=0.10,
)
print(tracker.summary())
# {"total": 1, "by_classification": {"CORRECT": 1}, "avg_execution_drift": 0.05, "success_rate": 1.0}
# Export for policy model training
records = tracker.training_records()
Environment variables
| Variable | Default | Description |
|---|---|---|
TRIGGUARD_API_KEY |
— | TrigGuard API key (required for live authorization) |
TRIGGUARD_GATEWAY_URL |
https://api.trigguardai.com |
TrigGuard gateway URL |
Install
pip install authgraph
Import as authgate:
from authgate import AGEFRuntime, ExecutionGraph, ExecutionNode, NodeStatus
For development:
git clone https://github.com/TrigGuard-AI/agef
cd agef
pip install -e ".[dev]"
pytest tests/
Authority boundary guarantee
# Zero TrigGuard internal imports in any authgate module except gate.py
grep -r "from trigguard\." authgate/ | grep -v gate.py # → 0 matches
# Zero receipt minting
grep -r "mint_receipt\|receipt_chain" authgate/ # → 0 matches
# authorize() called only in gate.py
grep -rn "\.authorize(" authgate/ | grep -v gate.py # → 0 matches
License
MIT — see LICENSE
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 authgraph-0.1.0.tar.gz.
File metadata
- Download URL: authgraph-0.1.0.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f1f922cd5c2d0c6cba28918403d6c7f39ffc1870276cfb3f153f3979c108793
|
|
| MD5 |
70e14e5a08740369d9fe6a213fcbe3f5
|
|
| BLAKE2b-256 |
5e6301555bb60b81a85cf86cf13738f5f3ff92eb63a516a0d1abfa510e447281
|
File details
Details for the file authgraph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: authgraph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2bd54dc93f74becde518063e436370881f9958fd0ea09a2fc486593d633373a
|
|
| MD5 |
f90303a17233ef9569715e2592d77453
|
|
| BLAKE2b-256 |
a7faf66c0fbd10f6b43818e905e263c8f9c3e98c4e5e79eba5d1ad6a286fc441
|