Open sourcePythonApache-2.0
Composable action governance for high-risk agent deployments

The policy gate for AI agent actions.

Govern declared AI agent actions before a side effect occurs. 5D applies versioned deterministic policy at the action boundary, with optional semantic evidence for context-sensitive cases.

When the host supplies the required action identity, routes every relevant path through the gate, and records the outcome, 5D's versioned decision records can help reconstruct what was evaluated and why. The host still owns identity validation, path coverage, execution, recovery, and any legal or assurance conclusion.

quickstart.py
$ pip install fivedrisk

from fivedrisk.hooks import gate

@gate(
  tool_name="write_to_database",
  autonomy_context=2,
)
async def write_record(table, data):
  ...

# GREEN or YELLOW → execute
# ORANGE → hold for host-owned review
# RED → block
Decisions in practice

Police the actions before they execute.

Explore all examples
RED · BLOCK

Verified block

Matched tested policy condition: regulated data cannot leave the approved destination set.

blocked before simulated execution
ORANGE · REVIEW REQUIRED

AI check + human review

Policy selected explicit human review. The simulated reviewer recorded acceptance; policy then resolved the declared review branch to PERMIT.

simulated permit · no external action
GREEN · PERMIT

Rule-based permit

The tool, target, purpose, and authority matched an explicit policy rule.

simulated permit · no external action
Use cases

Start with the action path you need to govern.

View all use cases ↗
Adjustable assurance

One authority boundary. Optional assurance layers.

Layer only what the risk path needs. The deterministic policy remains the permission authority. Optional observers add evidence; a policy-selected HITL step provides final approval.

Required foundation

Deterministic core

Applies declared prohibitions, thresholds, and routing policy to normalized action context.

Optional layer

Jev observer

Adds: typed semantic evidence for contextual risk signals.

Optional layer

Contextual LLM

Adds: host-selected review when intent cannot be reduced to fixed rules.

Final approval layer

Human-in-the-loop

Adds: final approval by an authorised human before the host may execute a policy-held action.

Fail-closed rule: observer evidence can tighten or hold a decision, but cannot clear an explicit block. When a required observer is missing, malformed, or timed out, the action is held or blocked according to policy. When policy requires HITL, missing or declined human approval keeps the action held or blocked.

Throughput economics

Route only the actions that need an observer.

Use deterministic policy for declared action paths, then reserve optional semantic evidence or human review for the cases your policy selects.

Proposed action Typed action envelope

Tool, target, purpose, principal, and context enter one declared contract.

Deterministic policy Evaluate before side effect

Versioned rules resolve declared inputs on documented integration paths.

Policy-routed evidence Optional Jev or observer

Observer evidence can tighten or hold. It cannot clear an explicit block.

Illustrative workload model

Change the declared assumptions.

Declared assumptions, not measured 5D performance.

365-day illustrative year. Currency is a display/input unit; no exchange-rate conversion is applied.

Deterministic-only actions / day6,500
Observer- or review-routed actions / day3,500
Estimated routed observer spend / year€6,387.50
One collaboration layer

Five owners, one versioned action contract.

Policy intent, implementation, threat review, human disposition, and reconstructable evidence stay connected without transferring organisational accountability to a model.

Start from public primitives: inspectable policy evaluation, verdicts, documented adapters and gateways, and evidence records. The support matrix states what version 0.7.0 verifies and what the host still owns.

  1. Policy ownerDefines rules and review thresholds
  2. EngineerIntegrates the action boundary
  3. SecurityChallenges threats and bypass paths
  4. ReviewerRecords the required human decision
  5. Evidence ownerMaintains replayable records

Routing share depends on your policy and traffic.

Observer cost is user-supplied; it is not a 5D price or forecast.

Estimated variable observer spend excludes deterministic infrastructure, human review, retries, and other deployment costs.

Model cost and latency vary with provider, model, caching, concurrency, and deployment design.

Normative integration contract

From Proposal to Action.

Open the complete action flow
01

Normalize

Describe the tool, target, data, identity, and autonomy context.

02

Apply policy

Run hard prohibitions first, then evaluate the five action-risk dimensions.

03

Observe and resolve

Add optional semantic evidence, then permit, hold, or block. Observers cannot clear an explicit block.

04

Act and record

The host executes or refuses, while disposition, review, and outcome remain separate.

No single package entry point implements every step. The integration support matrix shows what the tested core handles, what needs additional wiring, and what remains the host application's responsibility.

Stable release · 0.7.0

Add the gate to a supported tool-call path.

pip install fivedrisk
Implementation accelerator

Set up 5D with your coding agent.

The 5D setup skill helps a coding agent inspect an existing project, scaffold policy, wire a supported path, and run the verification checklist. It produces a reviewable integration; it is not proof that the surrounding deployment is secure.

Five dimensions · one action

Five questions before an agent action crosses the boundary.

5D provides an AI action-risk score from five independently inspectable dimensions. Each runs from lower to higher risk on the same 0 to 4 scale; the score informs policy rather than claiming confidence in the agent's reasoning.

See why these five dimensions
D

Data sensitivity

What information the action touches.

Public → secrets
T

Tool privilege

How much power the invoked tool holds.

Read-only → destructive
R

Reversibility

Whether the effect can be recovered.

Easy to undo → irreversible
E

External impact

How far the action can reach.

Local → untrusted external
A

Autonomy context

How far the action sits from a person.

User-direct → autonomous
Why 5D exists

Autonomy needed a security boundary.

5D began as the security layer inside a personal agentic system where useful autonomy needed a deterministic boundary around dangerous actions.

Read how 5D began
Who needs AI runtime governance

One authority boundary. Four operational questions.

Meet every persona ↗
Resources

Build it, inspect it, understand why it matters.

Explore all resources
Scope before slogans

What 5D evaluates, and what the surrounding system must still prove.

5D can contribute
  • Action-level risk across the five DTREA dimensions.
  • Explicit policy thresholds, destinations, and hard prohibitions.
  • Whether policy permits, blocks, or holds the proposed action.
  • Separate policy, review, execution, record, and export states.
Your application still owns
  • Coverage of every direct and alternate tool path.
  • Authentication of identity, grants, and reviewer authority.
  • Whether the agent's goal or recommendation is correct.
  • Execution, idempotency, reconciliation, custody, and recovery.

Technical evidence, not certification. 5D records what its declared policy path evaluated and decided; deployment assurance depends on the surrounding system.