SEC - CODEX AGENTS: idempotent audited tool writes

This commit is contained in:
DCCONSTRUCTIONS
2026-05-14 20:12:29 +03:00
parent c9519b52d2
commit 2c1e83dd37
14 changed files with 503 additions and 75 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ Acceptance:
- local Codex can move card state;
- local Codex cannot delete/archive.
Status: initial product slice implemented. `/mcp` supports JSON-RPC `initialize`, `ping`, `tools/list`, and `tools/call`. REST product endpoints and MCP tools share the same runtime, scope checks, grant checks, and Tasker adapter calls. `npm run smoke:mcp:e2e` verifies real local Tasker writes.
Status: initial product slice implemented. `/mcp` supports JSON-RPC `initialize`, `ping`, `tools/list`, and `tools/call`. REST product endpoints and MCP tools share the same runtime, scope checks, grant checks, idempotency handling, audit events, and Tasker adapter calls. `npm run smoke:mcp:e2e` verifies real local Tasker writes and idempotent replay.
## Phase 6. Agent identity
+9 -1
View File
@@ -308,7 +308,15 @@ All write tools must accept:
idempotency_key
```
Agent Gateway stores result mapping and returns the prior result for duplicate keys.
Agent Gateway requires this value for all write tools. The key is scoped by agent, hashed together with the tool name and normalized arguments, and stored with a processing/completed state.
Behavior:
- first successful request stores the tool result for 24 hours;
- duplicate key with identical arguments returns the stored result and does not call Tasker again;
- duplicate key with different arguments returns `idempotency_key_conflict`;
- duplicate key while the first request is still processing returns `idempotency_key_in_progress`;
- failed writes release the key so the same operation can be retried.
## Denied tools
+3 -1
View File
@@ -92,7 +92,9 @@ Risk: network retry creates duplicate cards/comments.
Mitigation:
- required idempotency keys for write tools;
- store operation result by token and idempotency key.
- store operation result by agent and idempotency key;
- reject same key with different arguments;
- release failed writes so safe retries can run again.
### Reporting mode false confidence