Step-by-step answer
Stretch 90 min6 stepsBuild scoped matter tools with the Agent SDK (stretch)
list_documents, grep, search and read as in-process Claude Agent SDK tools, built per request with the tenant and matter fixed in a closure, document IDs checked against an allow-list, regexes run with a timeout, and every call logged; seven hostile document IDs and a backtracking regex try to escape the scope, and the 30-question set runs through the SDK on OpenRouter or Ollama for comparison with the headless results.
Back to the exercise