Current collected state Current
Observed since 20 Oct, 18:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Gate FastAPI routes through ActionGate primitives.
Gate FastAPI routes through ActionGate primitives.
pip install actiongate-fastapi
from fastapi import FastAPI
from actiongate import Engine, Gate, Policy
from actiongate_fastapi import gated_route
app = FastAPI()
ag = Engine()
@app.post("/search")
@gated_route(
actiongate=ag,
gate=Gate("api", "search", "global"),
policy=Policy(max_calls=100, window=60),
)
async def search(query: str):
return {"results": do_search(query)}
Returns 429 for rate limit and budget blocks. Returns 403 for policy violations.
from fastapi import Depends
from actiongate_fastapi import gate_dependency
require_gate = gate_dependency(actiongate=ag)
@app.post("/search")
async def search(
query: str,
_=Depends(require_gate(
gate=Gate("api", "search"),
policy=Policy(max_calls=100, window=60),
)),
):
return {"results": do_search(query)}
pip install actiongate-fastapi[all]
from actiongate import Engine as AG, Gate, Policy
from budgetgate import Engine as BG, Ledger, Budget
from rulegate import Engine as RG, Rule, Ruleset, Context
from actiongate_fastapi import gated_route
from decimal import Decimal
ag, bg, rg = AG(), BG(), RG()
def no_pii(ctx: Context) -> bool:
return "ssn" not in str(ctx.kwargs).lower()
@app.post("/search")
@gated_route(
actiongate=ag,
gate=Gate("api", "search", "global"),
policy=Policy(max_calls=100, window=60),
budgetgate=bg,
ledger=Ledger("api", "search", "global"),
budget=Budget(max_spend=Decimal("50.00"), window=3600),
cost=Decimal("0.01"),
rulegate=rg,
rule=Rule("api", "search"),
ruleset=Ruleset(predicates=(no_pii,)),
)
async def search(query: str):
return {"results": do_search(query)}
Gates evaluate in order: ActionGate → BudgetGate → RuleGate → execute → AuditGate.
Apache-2.0. ActionGate and BudgetGate are Apache-2.0. RuleGate and AuditGate are BSL-1.1.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 15 Mar 2026 | 7 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 18:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f906d5d6d6f4bd6e9d6a681f31adf28fe8bf414191c4a729e3684c53e41a9984