Developers
BetaAsk before you act
Your agent calls TrustMesh before a protected tool call and proceeds only on ALLOW. Everything else — identity, permissions, policy, approvals, evidence — happens on the TrustMesh side.
Integration modes
Three ways in
REST decision API
BetaPOST /v1/runtime/authorize with an agent credential. Language-agnostic. Idempotent on call_id.
Python SDK
Beta@tm.protected(tool, action) wraps a function; raises ApprovalRequired or Denied; fails closed. In sdk/python, not yet on PyPI.
MCP gateway
PlannedPoint an MCP client at TrustMesh; it authorizes tools/call and fingerprints tools/list. Designed, not implemented.
Runtime authorization
One call per protected action
curl -s -X POST http://localhost:8800/api/v1/runtime/authorize \
-H "Authorization: Bearer $TRUSTMESH_AGENT_CREDENTIAL" \
-H "Content-Type: application/json" \
-d '{
"tool": "refunds",
"action": "process",
"params": {"order_id": "ORD-48213", "amount_usd": 1850, "reason": "Duplicate charge"},
"call_id": "ticket-7781-refund-1",
"session_id": "ticket-7781",
"justification": "Customer reported a duplicate card charge"
}'{
"request_id": "req_000231",
"decision": "require_approval",
"status": "pending_approval",
"reason_codes": ["POLICY_REQUIRE_APPROVAL"],
"explanation": "REQUIRE APPROVAL — decided by customer-data/refund-approval ...",
"risk_score": 35,
"approval": { "id": "apr_000232", "approver_role": "security_analyst", "expires_at": "..." }
}- allow → execute the tool, then optionally report the result.
- require_approval → do not execute; poll
GET /v1/runtime/requests/{id}untilmay_executeis true. - deny / quarantine → do not execute.
- Any non-200 or timeout → treat as deny.
Concepts
Authentication and resources
People
Session cookie from /v1/auth/login. Mutations require the X-CSRF-Token header. Only people can approve, activate policies or change permissions.
Automation
Management API keys (Bearer tmk_…) with scopes such as registry:write or policies:write. Never human-only actions.
Agents
Agent credentials (Bearer tmag_…) issued per agent. Accepted only by /v1/runtime/*.
Interactive OpenAPI documentation is served by the API at /v1/docs (and through this site at /api/v1/docs in local development).