1. Conduid
  2. Communication
  3. SafeAgent
MCP server · Communication

SafeAgent

A security-first control plane for autonomous AI code agents: sandboxed execution, hash grounding, diff validation, verification, and full auditability.

37Low

Scored a month ago · breakdown

About SafeAgent

SafeAgent is an MCP server in the Communication category: a security-first control plane for autonomous AI code agents: sandboxed execution, hash grounding, diff validation, verification, and full auditability.

Install

uvx
uvx safeagent-exec-guard
pip
pip install safeagent-exec-guard

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about SafeAgent

Powered by Claude · Grounded in docs

I know everything about SafeAgent. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

SafeAgent

AI agents retry. Retries fire side effects twice.

Duplicate payment. Duplicate email. Duplicate trade. Duplicate ticket.

SafeAgent is an execution guard that sits between an agent decision and an irreversible action. It gives every tool call a request ID, records a durable receipt on first execution, and returns that receipt on every retry — without running the side effect again.

pip install safeagent-exec-guard

Python 3.10+ · Apache-2.0 · Live demo


The problem

agent calls tool
    ↓
network timeout
    ↓
agent retries
    ↓
side effect runs twice

Most agent frameworks handle retries at the transport layer. None of them know whether the side effect already happened. SafeAgent does.


Quickstart

from settlement.settlement_requests import SettlementRequestRegistry

registry = SettlementRequestRegistry()

def send_invoice():
    print("Sending invoice...")

# First call — executes the side effect
receipt = registry.execute(
    request_id="invoice:C123",
    action="send_invoice",
    payload={"to": "c123@example.com"},
    execute_fn=send_invoice,
)

# Retry with the same request_id — returns the original receipt, no second send
receipt = registry.execute(
    request_id="invoice:C123",
    action="send_invoice",
    payload={"to": "c123@example.com"},
    execute_fn=send_invoice,
)

Same request_id → original receipt returned → side effect runs exactly once.


Works with any agent framework

  • OpenAI tool calls
  • LangChain tools
  • CrewAI actions
  • Claude / MCP tool execution
  • Any Python function that touches a real system

How it works

Every execution goes through a four-step control plane:

Agent decision
    → Finality gate      (is this outcome confirmed?)
    → Request-ID dedup   (has this exact call run before?)
    → Execute once       (run the side effect)
    → Receipt stored     (durable, survives restarts)

State machine: OPEN → RESOLVED → IN_RECONCILIATION → FINAL → SETTLED

Execution is only permitted from FINAL. Replays at any state return the stored receipt.


Key properties

  • Exactly-once execution — same request_id never fires twice
  • Durable receipts — SQLite-backed, survives process restarts
  • Finality gating — blocks execution on ambiguous agent signals
  • Confidence thresholds — auto-finalizes when consensus exceeds threshold
  • Audit trail — every execution recorded with payload and outcome

Run the demos

# Duplicate execution prevention
python examples/safe_agent_demo.py

# Stochastic agent signal simulation
python examples/simulate_ai.py

# Restart safety (run twice)
python examples/persist_demo.py
python examples/persist_demo.py

Production use

SafeAgent is a reference implementation and pattern library. If you're deploying this in a production agent system, see LICENSING.md for commercial options.


License

Apache-2.0

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About SafeAgent

How do I install SafeAgent?

Run uvx safeagent-exec-guard, then add the server to your MCP client's configuration.

Is SafeAgent safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is SafeAgent still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.