SafeAgent — Execution Guard for AI Agents

MCP金融服务

提供方 azender1

金融服务 未标注 OAuth 授权 社区 / 第三方 CursorCodexZed

Exactly-once execution guard for AI agents. Prevents duplicate payments, trades, and emails on retry with a claim-before-execute pattern. Exposes safeagent_claim and safeagent_settle as MCP tools over stdio.

一句话选型结论

按资料字段整理

SafeAgent — Execution Guard for AI Agents 属于金融服务类 MCP 服务器,传输方式未标注,OAuth 授权,可直接接入 Cursor、Codex、Zed,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类金融服务 传输方式未标注 鉴权OAuth 授权 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

金融服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

infrastructure

安装与配置

未标注 OAuth 授权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
行情与财务数据

查行情、财报、汇率等金融数据。

支付与账务查询

查订单、账单与交易流水。

风控与核验

做身份、信用与风险信息核验。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已适配 Cursor、Codex、Zed,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在金融服务场景里让模型直接调用外部能力的人。
  • 已经在用 Cursor、Codex 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
SafeAgent — Execution Guard for AI Agents当前 未标注 未标注 未标注 无 未标注
Alpaca MCP 62 stdio · 本地进程 支持远程部署 有 2026-05-18
OpenNews MCP 11 stdio · 本地进程 支持远程部署 有 2026-05-17
MCP Server 273df76d 未标注 stdio · 本地进程 本地部署 有 2026-05-17
tradingview-mcp 未标注 stdio · 本地进程 本地部署 有 2026-04-19
goat (Goat SDK) 未标注 未标注 未标注 无 2026-05-17

服务器档案

金融服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方azender1上游标注的维护方 azender1
分类金融服务本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Cross-platform本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

15.1 KB
来自项目仓库与上游目录的原文,未做删改

SafeAgent — Execution Guard for AI Agents

POST /claim · safeagent-production.up.railway.app
Dashboard: safeagent-dashboard-2.vercel.app```bash

Claim an action — free, no payment header required

curl -s -X POST https://safeagent-production.up.railway.app/claim \
-H "Content-Type: application/json" \
-d '{"request_id":"order:TQQQ:buy:6:2026-05-19T13:31:00-04:00","action":"order"}'

→ {"status":"PROCEED","request_id":"..."}

Settle after the action fires

curl -s -X POST https://safeagent-production.up.railway.app/settle/order:TQQQ:buy:6:2026-05-19T13:31:00-04:00 \
-H "Content-Type: application/json" \
-d '{"result":{"status":"completed"}}'

→ {"status":"committed","request_id":"..."}

Retry with the same request_id — returns SKIP

curl -s -X POST https://safeagent-production.up.railway.app/claim \
-H "Content-Type: application/json" \
-d '{"request_id":"order:TQQQ:buy:6:2026-05-19T13:31:00-04:00","action":"order"}'

→ {"status":"SKIP","request_id":"...","existing":{...}}

Free test endpoint — same logic, limited to 10 calls per IP

curl -s -X POST https://safeagent-production.up.railway.app/claim/test \
-H "Content-Type: application/json" \
-d '{"agent_id":"bot-1","action_type":"order","scope":"TQQQ:buy:bar:2026-05-19T13:31:00-04:00"}'

→ {"status":"PROCEED","request_id":"...","test":true,"calls_remaining":9}


Indexed on Bazaar.

## Measured CrewAI retry A/B

A credential-free experiment exercises CrewAI 1.15.21's actual same-process \`ToolUsage._use\` retry against SafeAgent 0.1.23. Across 30 post-effect/pre-confirmation trials, the unguarded path recorded two effects per logical action; the SafeAgent path recorded one effect and retained a \`PENDING\` claim for reconciliation.

**Scope:** scripted deterministic LLM and harmless effect recorded through an out-of-process capability-separated ledger. This does not validate process death, fresh-worker recovery, a real external provider, or SafeAgent Control reconciliation.

Method, source, tests, hashes, and 180-trial evidence

## SafeAgent Control founding pilots

Two bounded, read-only reconciliation pilots are open for outside operators. There is no fee unless SafeAgent Control identifies a previously unknown, reproducible discrepancy that the operator agrees is actionable.

Scope and outcome-based terms

---

---

## Mycelium Trails

This implementation is a Mycelium Provider.
Each completed action submits a trail to ARGENTUM with a content-addressed `action_ref`
(JCS+SHA-256 over the four preimage fields). The returned `mycelium_trail_id` is included
in every receipt for independent verification.

---

## Verified on Soma

SafeAgent is the first verified external integrator on Soma — the Mycelium agent catalog. Every production execution is anchored on-chain via Mycelium Trails and independently verifiable without going through the operator.

- **Integrator badge** — verified external client running Mycelium Trails in production
- **Live trails** — https://argentum-api.rgiskard.xyz/dashboard/trails?client=safeagent-prod
- **Public audit** — any auditor can verify SafeAgent executions independently

---

## What it does

SafeAgent is a durable execution-claim guard. It suppresses concurrent and repeated attempts that use the same stable `request_id`, and preserves unresolved attempts for reconciliation instead of silently retrying them.

Every action gets a stable `request_id` derived from the logical action. A new key returns `PROCEED`; a settled key returns `SKIP` with its stored result. A key left `PENDING` after a timeout or crash remains blocked because local state alone cannot prove whether the provider accepted the action. Recover it only after checking provider evidence or using provider-native idempotency.

**State machine:** `CLAIMABLE → PENDING → COMMITTED`; later claims observe `PENDING` or `SKIP`.

**Common failure modes SafeAgent prevents:**

| Scenario | Without SafeAgent | With SafeAgent |
|---|---|---|
| Stripe charge times out after acceptance | Retry may charge twice | Same key remains PENDING until provider reconciliation |
| Welcome email on signup retried | User gets two welcome emails | Second send returns SKIP |
| Webhook delivered twice (Stripe/GitHub/Twilio guarantee at-least-once) | Event processed twice | Second processing returns SKIP |
| Workspace provisioned on retry | Two workspaces created | Second provision returns SKIP |
| AI agent tool call retried after crash | Duplicate side effect | Same key stays blocked; outcome is explicitly unresolved |

> **Guarantee boundary:** SafeAgent proves local claim state, not the external outcome. `COMMITTED` means the caller settled a receipt. `PENDING` means unresolved—not failed and not confirmed successful. End-to-end exactly-once effects require provider-native idempotency and/or reconciliation with the provider's authoritative records.

---

## The stack

SafeAgent is the durable claim and duplicate-suppression layer in an agent execution integrity stack:```
Polaris (commit-gated authorization)
└── AgentGraph safety verdict (pre-execution safety gate)
    └── SafeAgent (durable claim guard)  ← you are here
        └── Mycelium Trails (on-chain anchor)

Each layer is independently authored and independently verifiable. None trusts the others.


API

POST /claim

Gate an action. Returns PROCEED on first call, SKIP on any repeat.

Request body:```json
{
"request_id": "order:TQQQ:buy:6:2026-05-19T13:31:00-04:00",
"action": "order"
}


- `request_id` — stable identifier derived from what the agent is doing. Same inputs = same key.
- `action` — the action type being gated (e.g. `payment.send`, `email`, `trade`, `order`)

**Response:**```json
{ "status": "PROCEED", "request_id": "order:TQQQ:buy:6:2026-05-19T13:31:00-04:00" }

Retry with the same payload:```json
{ "status": "SKIP", "request_id": "order:TQQQ:buy:6:2026-05-19T13:31:00-04:00", "existing": {...} }


### POST /settle/{request_id}

Settle a claim after the action fires. Advances status from PENDING to COMMITTED.```bash
curl -s -X POST https://safeagent-production.up.railway.app/settle/order:TQQQ:buy:6:2026-05-19T13:31:00-04:00 \
  -H "Content-Type: application/json" \
  -d '{"result":{"status":"completed","txid":"abc123"}}'
``````json
{ "status": "committed", "request_id": "..." }

POST /claim/test

Free test endpoint — same logic, no payment required. Limited to 10 calls per IP total.```bash
curl -s -X POST https://safeagent-production.up.railway.app/claim/test \
-H "Content-Type: application/json" \
-d '{"agent_id":"bot-1","action_type":"order","scope":"TQQQ:buy:6:bar:2026-05-19T13:31:00-04:00"}'
``````json
{ "status": "PROCEED", "request_id": "...", "test": true, "calls_remaining": 9 }


### GET /audit

Full claim history. Filter by `agent_id`, `action`, `status`, or timestamp range.```bash
curl "https://safeagent-production.up.railway.app/audit?agent_id=bot-1&status=COMMITTED"
``````json
{"items": [...], "total": 5, "limit": 100, "offset": 0}

Parameters: agent_id, action, status, from_ts, to_ts, limit (max 1000), offset.


Integration

Python```python

import requests

def claim(request_id: str, action: str) -> dict:
r = requests.post(
"https://safeagent-production.up.railway.app/claim",
headers={"Content-Type": "application/json"},
json={"request_id": request_id, "action": action}
)
return r.json() # {"status": "PROCEED"|"SKIP", "request_id": "..."}

def settle(request_id: str, result: dict) -> dict:
r = requests.post(
f"https://safeagent-production.up.railway.app/settle/{request_id}",
headers={"Content-Type": "application/json"},
json={"result": result}
)
return r.json()

Usage

response = claim("payment:customer-123:invoice-456", "payment.send")
if response["status"] == "PROCEED":
result = send_payment(...)
settle("payment:customer-123:invoice-456", {"status": "completed"})
elif response["status"] == "SKIP":
print("Already executed, skipping")


### SaaS (Stripe / email / webhooks)

For production Stripe PaymentIntents, use the permit-gated adapter documented
in SafeAgent Boundary.
It keeps the Stripe credential outside the agent, passes the consumed permit ID
to Stripe as the native idempotency key, persists the provider correlation,
verifies webhook signatures and supports authoritative read-back. The simple
claim/settle snippet below illustrates the generic API only; it is not the
provider adapter.

Run the bounded test-mode example in
`examples/stripe_payment_intent_guard.py`.
The verification record documents the observed
end-to-end result: one successful Stripe sandbox PaymentIntent, an exact replay
blocked before provider dispatch, and authoritative reconciliation by retrieve.```python
import requests

def safe_stripe_charge(customer_id, amount, idempotency_key):
    request_id = f"stripe:charge:{customer_id}:{idempotency_key}"

    response = requests.post(
        "https://safeagent-production.up.railway.app/claim",
        headers={"Content-Type": "application/json"},
        json={"request_id": request_id, "action": "stripe_charge"}
    ).json()

    if response["status"] == "SKIP":
        return response.get("existing")

    charge = stripe.PaymentIntent.create(
        amount=amount,
        currency="usd",
        customer=customer_id,
        idempotency_key=request_id,
    )
    requests.post(
        f"https://safeagent-production.up.railway.app/settle/{request_id}",
        headers={"Content-Type": "application/json"},
        json={"result": {"charge_id": charge.id}}
    )
    return charge

Webhook deduplication — stable event IDs suppress repeated processing after a settled result; unresolved PENDING events stay blocked for investigation:```python
def handle_stripe_webhook(event):
response = requests.post(
"https://safeagent-production.up.railway.app/claim",
headers={"Content-Type": "application/json"},
json={"request_id": event["id"], "action": "stripe_event"}
).json()

if response["status"] == "SKIP":
    return {"ok": True}

provision_subscription(event)
requests.post(
    f"https://safeagent-production.up.railway.app/settle/{event['id']}",
    headers={"Content-Type": "application/json"},
    json={"result": {"processed": True}}
)

### CrewAI```python
from crewai import Agent
import sqlite3

guard_con = sqlite3.connect("safeagent_orders.db", check_same_thread=False)
# ... same guard pattern, keyed on tool_name + input hash + session_id

PR crewAIInc/crewAI#5822 adds pluggable idempotency backends. SafeAgent's SQLite schema is compatible.

WisePick

WisePick is a deterministic routing layer for agent runtimes. The integration splits capability selection from durable, idempotent execution — WisePick answers what and which provider, SafeAgent answers whether this logical work already ran.

Stack:```
WisePick /v1/decide → DashClaw → SafeAgent → Mycelium Trails → Base/Arbitrum


- Adapter: `adapters/safeagent_adapter.py`
- Integration docs: `docs/integrations/safeagent.md`
- Integration thread: SafeAgent #9

---

## Local guard (embedded SQLite)

The same durable claim behavior without the network call. Drop this into any Python agent:```python
import json
import sqlite3

_SA_DB = "safeagent_orders.db"
_sa_con = sqlite3.connect(_SA_DB, check_same_thread=False)
_sa_con.execute("""CREATE TABLE IF NOT EXISTS orders (
    request_id TEXT PRIMARY KEY,
    result     TEXT,
    status     TEXT DEFAULT 'PENDING',
    created_at TEXT DEFAULT (datetime('now'))
)""")
_sa_con.commit()

def place_order_with_guard(symbol, qty, side, bar_ts):
    request_id = f"order:{symbol}:{side}:{qty}:{bar_ts}"

    cur = _sa_con.execute(
        "INSERT OR IGNORE INTO orders (request_id, status) VALUES (?, 'PENDING')",
        (request_id,)
    )
    _sa_con.commit()

    if cur.rowcount == 0:
        row = _sa_con.execute(
            "SELECT status, result FROM orders WHERE request_id = ?",
            (request_id,)
        ).fetchone()
        if row and row[0] == 'COMMITTED':
            print(f"SAFEAGENT SKIP: {request_id}")
            return row[1]
        raise RuntimeError(
            f"SAFEAGENT BLOCKED: unresolved PENDING claim for {request_id}"
        )

    result = place_order(symbol, qty, side)

    _sa_con.execute(
        "UPDATE orders SET status='COMMITTED', result=? WHERE request_id=?",
        (json.dumps(str(result)), request_id)
    )
    _sa_con.commit()
    return result

Case study: crash-retry duplicate prevention

A trading bot fires a market order to buy 6 shares of TQQQ. The broker accepts it. The bot crashes before updating state. On restart — same signal, same bar — the bot fires again. The broker fills it twice. The agent now holds 12 shares when it intended to hold 6.

This is not theoretical. It happens on any unhandled exception between order submission and state persistence.

SafeAgent derives a stable key before touching the broker:```
request_id = "order:TQQQ:buy:6:2026-05-19T13:31:00-04:00"


First call: PROCEED. Side effect fires. Settle writes COMMITTED.
Crash and retry: SKIP. Broker never touched again.

---

## Case study: live duplicate blocking — May 21, 2026

Six confirmed SKIP events from a live session on the full stack: DashClaw, SafeAgent, Mycelium Trails, Base/Arbitrum, broker Alpaca.

- 0942 ET: duplicate buy TQQQ qty=6 blocked, $452
- 0947 ET: duplicate add TQQQ qty=6 blocked, $452
- 0949 ET: duplicate sell TQQQ qty=12 on flip, $902
- 1000 ET: duplicate entry TQQQ qty=6 blocked, $454
- 1014 ET: duplicate sell TQQQ qty=18 on V20 flip, $1,350
- 1106 ET: duplicate SQQQ add during scale-in, $43

Full session data: https://gist.github.com/azender1/b9112b6519c935df4a75cb05cd250e26

---

## Conformance

SafeAgent participates in the A2A cross-implementation conformance corpus. Byte-verified fixtures across four independent implementations:

- kenneives (agentgraph) — verifier-attestation-v0: 30/30 ✓
- evidai (LemonCake) — gated-preflight-v1: 33/33 ✓
- haroldmalikfrimpong-ops (agentid) — independent verifier ✓
- SafeAgent — claim-lifecycle conformance v1.1 ✓

A2A #1920 closed. All four implementations satisfy freshness and replay requirements.

---

## Canonical `action_ref` derivation

JCS (RFC 8785), aligned with argentum-core, Nobulex, and APS:```python
import hashlib
import rfc8785

def compute_action_ref(
    agent_id: str,
    action_type: str,
    scope: str,
    timestamp: str,  # RFC 3339 UTC, 3-digit ms: "2026-05-15T10:00:00.123Z"
) -> str:
    payload = {
        "agent_id": agent_id,
        "action_type": action_type,
        "scope": scope,
        "timestamp": timestamp,
    }
    canonical = rfc8785.dumps(payload)
    return hashlib.sha256(canonical).hexdigest()

timestamp is an RFC 3339 UTC string with exactly 3 millisecond digits. The trailing Z is mandatory.

Conformance fixtures: giskard09/argentum-core tag action-ref-v1.0


Deployment

Railway · Serverless OFF · always-on
PyPI: pip install safeagent-exec-guard
npm: npm install n8n-nodes-safeagent
MCP Registry: io.github.azender1/safeagent
Dashboard: safeagent-dashboard-2.vercel.app


License

Apache-2.0

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
SafeAgent — Execution Guard for AI Agents 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

SafeAgent — Execution Guard for AI Agents 怎么在 Cursor、Codex、Zed 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

SafeAgent — Execution Guard for AI Agents 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

SafeAgent — Execution Guard for AI Agents 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

SafeAgent — Execution Guard for AI Agents 支持哪些客户端?

资料标注支持 Cursor、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

SafeAgent — Execution Guard for AI Agents 能提供哪些能力?

资料显示能力标签包括 infrastructure。具体工具清单以官方文档为准。

SafeAgent — Execution Guard for AI Agents 需要什么运行环境?

运行时为 Cross-platform。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。