Modify an existing ado-aw agent file — a markdown document with YAML front matter that the ado-aw compiler transforms into a secure, multi-stage Azure DevOps pipeline. Read the entire agent file before making any changes.
Interactive mode — ask the user what they want to change, confirm each modification, and explain any side-effects (e.g., adding permissions.write when a write-requiring safe output is introduced).
Non-interactive mode — apply the requested changes directly, validate the result, and report what was changed and why.
In both modes, follow the update workflow below.
Read the full agent markdown file. Identify:
- Front matter fields currently set (name, description, engine, schedule, pool, target, workspace, etc.)
- MCP servers configured and their
allowed:lists - Safe outputs enabled and their configuration
- Permissions (
read/write/ both / neither) - Repositories and checkout configuration
- Steps (setup, teardown, steps, post-steps)
- Network allow/blocked lists
- Agent instructions (the markdown body after the closing
---)
Do not proceed until you understand the current state.
Modify only what the user requests. Do not refactor unrelated sections, reorder fields, or rewrite the agent instructions unless asked.
When adding new fields, place them in the conventional front matter order:
name → description → target → engine → schedule → workspace → pool →
repositories → checkout → tools → mcp-servers → safe-outputs →
triggers → steps → post-steps → setup → teardown → network →
permissions → parameters
Run through the validation checklist (see below) before finalizing. Fix any issues and inform the user of corrections made.
After any front matter changes, the pipeline YAML must be regenerated:
ado-aw compile <path/to/agent.md>Important: Changes to the markdown body (agent instructions) do not require recompilation — the agent reads its instructions from the source
.mdfile at runtime.
| Change | Recompile? |
|---|---|
| Any YAML front matter field | Yes — run ado-aw compile |
| Agent instructions (markdown body) | No — loaded at runtime |
| Adding/removing safe outputs | Yes |
| Changing schedule | Yes |
| Adding/removing MCP servers | Yes |
| Updating permissions | Yes |
| Editing the agent's task description | No |
| Adding steps / post-steps / setup / teardown | Yes |
| Changing network allow/blocked lists | Yes |
Example: adding comment-on-work-item to an existing workflow.
- Add the safe output configuration to the front matter:
safe-outputs:
# ... existing safe outputs ...
comment-on-work-item:
max: 3
target: "MyProject\\MyTeam" # Required — scoping policy- Ensure
permissions.writeis set (required for write operations):
permissions:
write: my-write-arm-connection-
Update the agent instructions to explain when and how to use the new tool.
-
Recompile:
ado-aw compile <path/to/agent.md>
Example: changing from daily to weekly.
# Before
schedule: daily around 14:00
# After
schedule: weekly on monday around 9:00The fuzzy schedule syntax scatters execution time deterministically based on the agent name hash. The actual cron time will be within ±60 minutes of the specified time.
Schedule quick reference:
| Expression | Meaning |
|---|---|
daily around 14:00 |
Within ±60 min of 2 PM UTC |
weekly on monday |
Every Monday, scattered time |
weekly on friday around 17:00 |
Friday ~5 PM UTC |
hourly |
Every hour, scattered minute |
every 2h |
Every 2 hours |
bi-weekly |
Every 14 days |
daily between 9:00 and 17:00 |
Business hours |
Append utc+N or utc-N for timezone conversion: daily around 9:00 utc-5
To schedule on branches other than main, use the object form:
schedule:
run: weekly on monday around 9:00
branches:
- main
- release/*Recompile after any schedule change.
Example: adding the first-class azure-devops tool.
tools:
azure-devops: true
# Or with scoping:
# azure-devops:
# toolsets: [repos, wit]
# allowed: [wit_get_work_item, core_list_projects]
# org: myorgWhen adding azure-devops, also ensure:
permissions.readis set (the agent needs a token to query ADO APIs)- The compiler auto-adds ADO-specific hosts to the network allowlist
For custom containerized MCP servers:
mcp-servers:
my-tool:
container: "node:20-slim"
entrypoint: "node"
entrypoint-args: ["path/to/server.js"]
allowed:
- do_thing
- get_statusCustom MCPs must have an explicit allowed: list. Add any required external domains to network.allowed.
Example: enabling read-only ADO API access for the agent.
permissions:
read: my-read-arm-connection| Config | Effect |
|---|---|
read only |
Agent can query ADO APIs; no safe-output writes |
write only |
Agent has no ADO API access; safe-outputs can write |
| Both | Agent reads; safe-outputs write |
| Neither | No ADO tokens anywhere |
If adding write-requiring safe outputs (create-pull-request, create-work-item, comment-on-work-item, update-work-item, create-wiki-page, update-wiki-page, link-work-items, upload-attachment, create-branch, create-git-tag, add-build-tag, add-pr-comment, reply-to-pr-comment, resolve-pr-thread, submit-pr-review, update-pr, queue-build), you must also add permissions.write. The compiler will error otherwise.
Inline steps run inside the Agent job:
steps: # BEFORE agent runs
- bash: echo "Preparing context..."
displayName: "Prepare context"
post-steps: # AFTER agent completes
- bash: echo "Processing outputs..."
displayName: "Post-process"Separate jobs run before/after the entire pipeline:
setup: # Separate job BEFORE Agent
- bash: echo "Provisioning..."
displayName: "Setup"
teardown: # Separate job AFTER Execution
- bash: echo "Cleanup..."
displayName: "Teardown"Changes to the markdown body (after the closing ---) do not require recompilation. The agent reads its instructions from the source .md file at runtime.
When updating instructions:
- Preserve the existing structure unless the user asks for a rewrite
- If new safe-output tools were added, explain when the agent should use them
- If new MCP servers were added, describe the new capabilities available
- Keep instructions concise — the agent reads them on every execution
Before finalizing any update, verify:
-
Write permissions: Every write-requiring safe output has a corresponding
permissions.writeconfigured. -
MCP allow-lists: Custom MCP servers (with
container:orurl:) have explicitallowed:lists. -
Schedule syntax: The schedule expression uses valid fuzzy schedule syntax. Valid frequencies:
daily,weekly on <day>,hourly,every Nh,every N minutes,bi-weekly,tri-weekly. Valid time specs:around HH:MM,between HH:MM and HH:MM. -
Repository aliases: Every alias in
checkout:exists inrepositories:. -
Workspace consistency: If
workspace: repois set, ensurecheckout:has additional repositories. If onlyselfis checked out,workspace: repois unnecessary (the compiler warns about this). -
Network domains: If new MCPs or external services are added, ensure required domains are in
network.allowed. -
Target compatibility: Both
standaloneand1estargets support containerized MCPs via MCPG. -
Safe output
targetfields:comment-on-work-itemrequires an explicittargetfield.update-work-itemfields require explicit opt-in (status: true,title: true, etc.). -
Parameter names: Runtime
parameters:names must be valid ADO identifiers. -
Engine model: If
engineis set to the default (claude-opus-4.5), it can be omitted.
---
name: "Code Review Bot"
description: "Reviews open PRs for common issues"
schedule: daily around 10:00
permissions:
read: my-read-sc
---
## Instructions
Review all open pull requests and leave comments on any issues found.---
name: "Code Review Bot"
description: "Reviews open PRs for common issues and creates tracking work items"
schedule: weekly on monday around 10:00
permissions:
read: my-read-sc
write: my-write-sc
safe-outputs:
create-work-item:
work-item-type: Bug
tags:
- automated
- code-review
max: 5
---
## Instructions
Review all open pull requests and leave comments on any issues found.
### When Issues Are Found
For each significant issue, create a work item using `create-work-item` with:
- A clear title describing the issue
- A description with the PR link, file path, and explanation
### When No Issues Are Found
Use `noop` with a summary of what was reviewed.Changes made:
- Updated
descriptionto reflect new capability - Changed
schedulefromdailytoweekly on monday - Added
permissions.write(required forcreate-work-item) - Added
safe-outputs.create-work-itemconfiguration - Updated agent instructions to describe when to create work items
Recompilation required: Yes — front matter was modified.
After completing an update:
- Summarize changes — list each front matter field that was added, modified, or removed.
- Note recompilation — state whether
ado-aw compileis needed. - Flag validation issues — report any checklist items that were auto-corrected.
- Provide next steps:
Next steps:
1. Review the changes in <filename>.md
2. Recompile: ado-aw compile <path/to/agent.md>
3. Commit both the updated .md source and regenerated .yml pipeline
If only agent instructions were changed:
Next steps:
1. Review the changes in <filename>.md
2. Commit the updated .md file (no recompilation needed)
For complete field documentation, schema details, and all available safe output tools, see the full project reference:
https://raw.githubusercontent.com/githubnext/ado-aw/main/AGENTS.md