Safety Model
Every MCP tool on anymrkt follows the same safety contract: preview-first, confirm-gated, fully logged, always reversible.
1. Preview-first: preview: true
Every mutating tool accepts preview: true. When set, the tool returns what it would change without writing to the database.
tools.call("create_listing", {
"brandId": "brand-uuid",
"title": "Hand-thrown mug",
"preview": true
})2. Confirm gates: confirm: true
Publishing, deleting, connecting channels, and cancelling bookings require explicit confirm: true. Without it, the tool returns an authorization error.
3. Audit logging
Every mutation is recorded in mcp_operations with:
- Token ID + owner ID
actor_type = 'agent'- Tool name, args (secrets redacted)
- Before/after row state
run_idtying calls to the agent session
4. Revert: revert_run
tools.call("revert_run", {"run_id": "agent-session-uuid"})5. Never permitted (FR36)
Hard-blocked in authorizeToolCall() in lib/mcp/auth.ts:
- Change where payouts go
- Issue refunds or charge payments
- Accept legal or policy terms
- Delete a brand
- Read passwords, payout details, or card numbers