Incident to policy
A bad outcome already starts a lesson. Lessons that propose a policy change are still to build.
Use case
Incident to policy: a workflow across RepoOps, PromptCompute, ContextFile that starts from an incident closes in RepoOps, or an approved action turns out badly.
Who would use it
Builders and whoever is on call.
What value it provides
The lesson from an incident proposes a policy change, publishes a new context version that agents read, and gets a drill to prove it holds.
Why it matters to the user
Each incident makes the next one less likely, and you can show which lessons have a check behind them.
The problem
Postmortems produce lessons that nobody enforces, so the same error comes back.
Expected outcomes
- Lessons with a check (PromptCompute's own brain: 16 of 21 on 2026-11-07)
- Errors that came back after a lesson
- Days from incident to enforced policy
Each run records its outcome as met, not met or not measured.
How it runs
Products and connections
| Product | Role in this workflow | Docs |
|---|---|---|
| RepoOps | Open a lesson candidate from the incident; File it for review (propose_brain_entry) | Reference · RepoOps docs |
| PromptCompute | Propose the policy change the lesson implies; Run the new rule in a shadow test first; A person promotes the lesson | Reference · PromptCompute docs |
| ContextFile | Publish a new context version with the lesson | Reference · ContextFile docs |
Outside the family: GitHub.
What a person approves
| Action | Default risk |
|---|---|
memory.lesson.promote | medium |
memory.agentmd.publish | medium |
Action keys are from the PromptCompute catalog.
How to access it from an agent
An agent will run this workflow through the PromptReports MCP server or API, with an ID agent token. The runner will then call each product for it. Proposed
// MCP: https://mcp.promptreports.ai/mcp (Proposed)
start_run({
workflow: "incident-to-policy",
inputs: { "incident": "INC-311", "repo": "northwind/api" },
dry_run: false
})
// returns { run_id, status: "running", approvals_url }
get_run({ run_id }) // poll, or subscribe to run eventscurl -X POST https://api.promptreports.ai/v1/runs \
-H "Authorization: Bearer $PROMPTREPORTS_AGENT_TOKEN" \
-d '{"workflow":"incident-to-policy"}'Or call the products yourself, step by step:
| Product | Endpoint | Tools |
|---|---|---|
| RepoOps | https://mcp.repoops.ai/mcp | search_brain get_pre_edit_context propose_brain_entry get_incident_attribution |
| PromptCompute | https://mcp.promptcompute.ai/mcp | request_approval get_approval cancel_approval answer_approver |
| ContextFile | Built | to confirm |
Set it up
- Sign in at app.promptreports.ai with PromptReports ID, and pick your org.
- Connect RepoOps, PromptCompute, ContextFile on the Connections page. Link GitHub through the product that uses it.
- Register the agent that will run it on the Agents page, and give it a version manifest.
- Set the approval policy for memory.lesson.promote, memory.agentmd.publish. Start with Require approval; critical actions are never auto.
- Fill in the inputs (Incident, Repo) and choose the trigger: an incident closes in RepoOps, or an approved action turns out badly.
- Start a dry run. It will count no workflow request, and it shows which steps would record missing evidence.
- Start the run. Approve each gate in the approvals inbox, then read the signed record when it ends.