Module 04 Activity
Scenario
Your agents are about to be given tools, knowledge and access. Everything here is about making misuse impossible rather than discouraged.
What you build
A tool layer that is read-only where possible, self-validating always, and tested without any agent - plus per-agent scoping and staleness budgets.
Steps
- Write one tool with all three safety properties: read-only, validates its own input, never raises.
- Test it directly with
.run()against every refusal branch, including a hostile input. No agent, no key. - Scope tools per agent so that only one agent holds any write capability. Print each agent's tool list.
- Give each knowledge source a staleness budget based on how often that kind of document changes, and flag anything past it.
- Take a multi-turn exchange and extract the established facts into named fields instead of passing the transcript.
- Report your tool test coverage as a fraction of branches, not of tools.
Evidence to hand in
- The tool with its three properties identified.
- Direct test results covering every refusal branch.
- Per-agent tool lists showing where write access lives.
- The staleness budgets with the change-frequency reasoning.
- The extracted-fields version of a conversation.
- Branch coverage as a fraction.
Review checklist
- The tool returns strings on failure and never raises.
- Every refusal branch has a direct test.
- Exactly one agent holds write access, and the others physically lack it.
- Staleness budgets differ per source with a stated reason.
- The conversation was reduced to fields, not summarised into prose.
