authgraph
Show me what will happen before the AI executes anything.
Python execution planning + TrigGuard authorization simulation. No permit, no run.
pip install authgraph
from authgraph import Plan, simulate
plan = Plan()
plan.add("file.read", read_file, title="read_file")
plan.add("git.push", push_branch, title="push_branch")
result = simulate(plan)
print(result) # predicted PERMIT / ESCALATE / BLOCKED per step
print(plan.visualize()) # execution graph
Before anything runs, authgraph asks TrigGuard. Simulation never executes your callables.
Your code → authgraph → TrigGuard → Gateway
Not a CrewAI/LangGraph/Quanta product. Optional integration hooks live under authgraph.integrations and do not bundle external runtimes.
Requires TRIGGUARD_API_KEY, TRIGGUARD_ORG_ID, and gateway https://api.trigguardai.com (default).
Full guide: docs/QUICKSTART.md
APIs (0.3)
| API | Use when |
|---|---|
Plan + simulate() |
Preview authorization for a multi-step agent pipeline |
plan.execute() |
Run steps after PERMIT; cascade BLOCKED on DENY/ESCALATE |
explain() |
Human-readable DENY/ESCALATE with suggested actions |
plan.visualize() / export_dot() |
Console tree or Graphviz DOT |
@guard() |
Single function — zero graph boilerplate |
AuthgraphRuntime + run_step |
Multi-step DAG workflows |
from authgraph import Plan, PlanBuilder, simulate, explain, guard
CLI:
authgraph simulate examples/deployment.py
authgraph explain receipt_123 --action deploy.release
authgraph graph examples/deployment.py --dot
Demos: examples/demos/ (agents, GitHub Actions, DB migrate, Terraform, K8s, robotics)
Quick start (@guard)
import os
from authgraph import AuthgraphRuntime, run_step
os.environ["TRIGGUARD_API_KEY"] = "tg_live_..."
os.environ["TRIGGUARD_ORG_ID"] = "org_..."
runtime = AuthgraphRuntime()
graph = runtime.create_graph(title="Deploy", description="Plan then ship")
repo = os.environ.get("TRIGGUARD_REPOSITORY", "your-org/your-repo")
plan = runtime.add_node(
graph, title="Plan", description="Define scope",
authority_surface="deploy.release", metadata={"repository": repo},
)
runtime.start(graph)
result = run_step(
runtime, graph, plan, agent_id="my-agent",
fn=lambda: {"spec": "ship it"},
)
print(result.receipt, result.execution_time)
More examples: examples/
What is shipped (0.3)
- Execution plans —
Plan,PlanBuilder, sequential steps with metadata - Simulation —
simulate()/plan.simulate()never runs callables; queries TrigGuard - Graph execution —
plan.execute()with downstream BLOCKED cascade - Explainability —
explain()for receipts, decisions, gateway JSON - Risk breakdown —
result.risk_score,result.risk_factors(local heuristic, not policy) - Visualization — console tree + Graphviz DOT export
- CLI —
authgraph simulate|explain|graph - Universal execution engine (
authgraph.execution) — one claim/execute/complete path @guard,authorization(), sync + async + batch- Optional integrations (CrewAI, LangGraph, …) — thin hooks only
- Fail-closed TrigGuard gate
Not shipped: hosted service, bundled agent frameworks, policy duplication, GitHub Apps, K8s controllers, Terraform providers (build when design partners ask).
Environment
| Variable | Required | Description |
|---|---|---|
TRIGGUARD_API_KEY |
yes | Customer API key |
TRIGGUARD_ORG_ID |
yes | Org id (X-Consumer) |
TRIGGUARD_GATEWAY_URL |
no | Default https://api.trigguardai.com |
TRIGGUARD_REPOSITORY |
no | Auto metadata for deploy surfaces |
TRIGGUARD_ACTOR |
no | Default actor for @guard / context manager |
License
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.3.0.tar.gz.
File metadata
- Download URL: authgraph-0.3.0.tar.gz
- Upload date:
- Size: 48.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b50b18b0d39969797232e692d7e29d1ef5fb2dc49d077a9f3fa0f61d0011e3f
|
|
| MD5 |
04fd7d563b6b76e001e67e61e8564200
|
|
| BLAKE2b-256 |
95cedb305602d0edd309b00bec415e22b78932c1cf85bfd6c2ef2e60f8f2c401
|
File details
Details for the file authgraph-0.3.0-py3-none-any.whl.
File metadata
- Download URL: authgraph-0.3.0-py3-none-any.whl
- Upload date:
- Size: 43.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 |
7738e73e356ab319d4e649b0ac763227adaabba6b76b60631d2a6d933eebc799
|
|
| MD5 |
ed6dc5ecee98e89c195df838aee0b708
|
|
| BLAKE2b-256 |
c878ed3c78335daf2adb28840d744cccb5c66be2080af1302696dcc46de5f2ae
|