5D integration

5D for Claude Code and Claude Agent SDK

Add runtime policy in front of Claude Code hooks so low-risk reads stop spamming the user and high-impact actions can be reviewed or blocked.

Pain it solves

Claude Code users hit approval fatigue fast once the loop gets longer. Auto modes remove friction, but they also remove the last useful checkpoint if you have shell, write, or network tools in play.

Best when you need PreToolUse gating, PostToolUse output checks, and review handoff without tying yourself to Anthropic-only logic.

When to use 5D

Use 5D when your agent can write files, run shell, call external APIs, or touch sensitive tools.

In this setup, 5D returns a normalized runtime decision: allow, review, or deny, plus a tripwire_triggered flag for runtimes that want a simpler guardrail signal.

Install

git clone https://github.com/theDoc001/fivedrisk.git
cd fivedrisk
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Minimal example

from fivedrisk.hooks import configure, fivedrisk_post_tool, fivedrisk_pre_tool

configure(
    policy_path="policy.yaml",
    log_path="fivedrisk.db",
    review_endpoint="https://review.example.com/5d",
)

hooks = {
    "PreToolUse": [fivedrisk_pre_tool],
    "PostToolUse": [fivedrisk_post_tool],
}

Next step

Try the integration, then keep the policy layer yours.

5D gives you a portable policy layer you can run locally, keep provider-neutral, and hand off to a user or external review agent when needed.

Open source under Apache-2.0 and provided as-is. You are responsible for review, testing, configuration, sandboxing, and deployment in your own environment.