{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "rohitg00-ai-engineering-from-scratch--gate-agent-tool-calls-with-approval-receipts",
 "repo": "rohitg00/ai-engineering-from-scratch",
 "repo_url": "https://github.com/rohitg00/ai-engineering-from-scratch",
 "repo_slug": "rohitg00-ai-engineering-from-scratch",
 "title": "Block replayed or altered agent write approvals",
 "page_title": "How to block replayed or altered agent write approvals with AI Engineering From Scratch",
 "summary": "Check role and path on agent tool calls, consume each approval once, and write an audit receipt.",
 "who": "A developer building an agent that proposes writes and needs an approval step with a clear audit trail.",
 "problem": "A write can change after review, or an approval can be replayed to run a different operation.",
 "outcome": "An audit receipt that shows the requested operation and the policy decision, with approvals bound to the exact request.",
 "steps": [
  "Confirm a Rust toolchain is installed, since the README names Rust but does not give a version. (inferred, check the README)",
  "Run `python3 scripts/project_test.py tool-call-firewall --init learning-artifacts/tool-call-firewall` from the repository root. (inferred, check the README)",
  "Validate the call envelope and check the caller's role and path in the starter.",
  "Consume an approval bound to the exact request and content, then run `python3 scripts/project_test.py tool-call-firewall --all --path learning-artifacts/tool-call-firewall --strict`. (inferred, check the README)",
  "Keep the audit receipt and confirm the replay test fails."
 ],
 "agent_prompt": "In the repo rohitg00/ai-engineering-from-scratch, run the tool-call-firewall project with --init into learning-artifacts/tool-call-firewall, then implement the stages until the --all --strict grader passes. Expected output: an audit receipt for each tool call with the policy decision. Verify that a replayed approval and an altered write are both rejected.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The caller application supplies identity, and the project does not provide persistent authorization or an operating-system sandbox.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Node.js, npx, and python3 installed for the coding agent tutor",
  "A skill-capable coding agent such as Claude Code or Codex, with a writable skills scope",
  "Python 3.10 or newer for the retrieval and firewall projects",
  "Node.js 22.18 or newer for the agent trace debugger",
  "A clone of the repository so the project_test.py grader is available"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/rohitg00-ai-engineering-from-scratch/gate-agent-tool-calls-with-approval-receipts/",
 "md": "https://dedupedai.com/use-cases/rohitg00-ai-engineering-from-scratch/gate-agent-tool-calls-with-approval-receipts/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/rohitg00-ai-engineering-from-scratch--gate-agent-tool-calls-with-approval-receipts.json",
 "api_version": "v1"
}
