Write agent instructions
Give an agent a task using text or a Markdown template.
Use the configuration from setup. Save the two files below together and run node feature.ts after adapting the feature and test command to your project. The answer and branch are the results to inspect.
Choose text or a file
Section titled “Choose text or a file”The brief contains the instructions you send to the agent. Use text for a request written in your script, or file for instructions you want to keep and reuse in Markdown.
Text brief { text } | File brief { file, values } | |
|---|---|---|
| Source | A string built by your code | A Markdown file kept next to your scripts |
| Variables | None: interpolate in your code | {{NAME}} from values, WORK_BRANCH, BASE_BRANCH |
| Command output | None | !`command` replaced by its output |
| Best for | Generated or one-off requests | Reusable tasks shared by several scripts |
A text brief is sent as written. The rest of this page covers file briefs.
Fill a template
Section titled “Fill a template”Write placeholders as {{NAME}}, with letters, digits and underscores. Outpost reads the file and fills them before the agent starts.
A relative file resolves from the process working directory. Build the path from import.meta.url so the script runs from anywhere.
If a placeholder has no value, the task fails with code prompt before the agent starts. If you provide a value that the file does not use, Outpost reports it through warn.
Insert command output
Section titled “Insert command output”Write !`command` to replace the fragment with what the command prints. Use it to hand the agent a failing test log or recent history.
The commands run in the sandbox, in the checkout the agent works on, with sh -c. Before each pass, all commands of the brief run in parallel.
- OutputOnly stdout is inserted; add
2>&1to include errors. - FailureA nonzero exit fails the task with code
promptand stops the other commands. - Deadline
expansionMsbounds each command; the default is 30 seconds.
Values cannot add commands: Outpost finds the !` fragments in the file before it fills placeholders.
Instruct the agent, enforce in code
Section titled “Instruct the agent, enforce in code”Instructions tell the agent what you want it to do. If a condition determines whether the work is accepted, check that condition in your workflow code.
| Condition | Ask in the brief | Enforce in code |
|---|---|---|
| Tests pass | “Run npm test.” | Run them yourself in a sandbox session or a verification loop. |
| Answer format | “Reply with a JSON list.” | Validate a typed response. |
| Files left untouched | “Do not edit config/.” | Inspect the diff, or deny writes with the built-in harness permissions. |
| Human sign-off | “Do not merge yet.” | Stop at an approval gate. |
Providing a typed response automatically adds its final-answer format after the rendered brief; JSON contracts also include the input JSON Schema. You do not need to put its tags in the brief.
Limits
Section titled “Limits”- Text briefs do not accept
valuesand never run commands. WORK_BRANCHandBASE_BRANCHare reserved: passing them invaluesis a configuration error.BASE_BRANCHis empty when your repository has a detachedHEAD.- A command cannot contain a backtick.
- With host execution, commands run on your machine:
sh -c, or PowerShell on Windows. - A generated
{{WORK_BRANCH}}and command output change between runs; see Replay without a model.
API: Brief · PromptVariables · DispatchOptions · dispatch.

