What this prompt does
This prompt has the model act as a senior AI agent engineer and specify an autonomous research agent tightly enough to build, returning working pseudocode and prompts rather than hand-waving. You set the [model], a hard [budget] in tokens, the [tools] it can use, and the [report_format], and it produces the full agent loop, token accounting, tool-use prompts, summarisation strategy, citation handling, and final assembly.
The structure works because it treats the runaway loop as the central risk: an agent that quietly eats the whole [budget] before producing anything useful. Steps for token accounting and a stop condition are what make the agent safe to run unattended, and they're meant to be wired before adding more [tools]. Citation handling ties every claim to a fetched source, and the output is shaped to [report_format] with a self-critique pass. By demanding working pseudocode and prompt templates rather than hand-waving, the prompt gives you the loop, the contracts for each tool, and the compression strategy you actually need to keep a long run coherent.
When to use it
- You're building an agent that plans, searches, and writes a report on its own.
- You need a hard token
[budget]enforced so runs can't spiral in cost. - You want a plan-act-observe-reflect loop with an explicit stop condition.
- You need every claim mapped to a fetched source for verifiable output.
- You want note-compression so long runs stay under budget.
- You want the agent safe enough to run unattended.
- You want a self-critique pass that catches weak claims before the report ships.
Example output
Expect full pseudocode for the agent loop — plan, act, observe, reflect, with a stop condition — followed by every prompt template. You'll get token accounting that tracks spend per step and halts gracefully near [budget], input/output contracts for each of your [tools], a summarisation strategy, citation handling, and final assembly into [report_format] plus a self-critique pass. It's a buildable blueprint, not prose advice.
Pro tips
- Set
[budget]to a real ceiling you can afford; it's the value the stop condition defends, so vague numbers make the safety guarantee meaningless. - Wire token accounting and the stop condition (steps 1 and 2) before adding more
[tools]— that order is what keeps unattended runs safe. - List
[tools]precisely (e.g.web_search, fetch_url, save_note) so each gets a clear input/output contract. - Choose
[model]deliberately; a pricier model burns the[budget]faster, which changes how aggressive your note compression must be. - Specify
[report_format]concretely (e.g. structured Markdown with sections and a sources list) so final assembly has a target to hit. - Keep the citation rule strict so the self-critique pass can flag claims with no fetched source.