Remediations
What agents propose, the diff of exactly what Wardn would do, and who decides.
A remediation is something an agent proposes: a fix to code, a change to a values file, an action on a cluster, or a release step. An agent only proposes. A person approves a proposal, and Wardn then makes the change itself with its own credentials. The agent never holds a write credential, never merges, and cannot approve anything.
What a proposal holds
Each proposal has a number (RM-41), a kind with a payload typed by that kind, and a diff of exactly what Wardn would do. For a change to files the diff is computed by Wardn from the real files at the head of the base branch, not from what the agent says they hold, so it shows what would be pushed.
| Kind | What it is |
|---|---|
code_fix | Changed files on a branch agent/… and the pull request Wardn opens from it. |
config_change | A change to one values file, as a pull request on the config repository. |
cluster_action | restart, rollback, scale or revert_drift on a deployment. There is no delete. A scale names the cluster, the workload (workloadKind Deployment or StatefulSet, and workload) and replicas; it lasts until the deployment's next snapshot is applied, which sets the snapshot's count again, and it is not reported as drift meanwhile, so to change a count for good propose a config change. A workload an autoscaler drives is refused. |
raise_release, advance_wave, rollback | Release steps. An agent that may act with approval or more proposes them; one that may only recommend is refused. |
A payload with a field its type does not have is refused, so a field that means "merge" cannot be smuggled in. File paths stay inside the repository, a branch is never the base branch, and a proposal that changes nothing is refused.
Risk
Wardn judges the risk of every proposal when it is made, from what the change touches and where it lands. What the agent says about it is never read. The level and the reason are stored with the proposal; the reason is the tooltip of the Risk tag on the list and on the proposal's page.
| Level | When | Reason shown |
|---|---|---|
| High | It touches the CI or deploy files of a protected branch (.github/, .circleci/, .buildkite/, deploy/, Dockerfile, Jenkinsfile, .gitlab-ci.yml) | Touches CI or deploy files of a protected branch. |
| A guardrail or a freeze holds its target | A guardrail or a freeze holds the target. | |
| It reaches more than one production deployment | Reaches several production deployments. | |
| Medium | Code or config that reaches production | Touches production code. / Touches production config. |
| A cluster action or release step on production | Acts on production. | |
| Wardn could not read where it lands | Wardn could not read where it lands. | |
| Low | Test files only (*_test.go, *.test.*, *.spec.*, test/, tests/, __tests__/, testdata/) | Changes test files only. |
| Any change outside production | Does not reach production. |
Facts Wardn could not read make a proposal medium before anything else is looked at; after that the rules are checked from high to low, so a change that is both test-only and held by a guardrail is high. Risk does not decide who may approve or whether a rule may cover a proposal; the never auto-approved list does that.
What a proposal is tied to
A proposal says which deployments it reaches, and everything it acts on must be among them. A payload that names a deployment the proposal does not (a restart of one deployment inside a proposal for another, a release of a deployment that is not listed) is refused, because the agent was checked at the deployments it listed and nowhere else.
A change to a repository reaches every deployment that runs from it. Wardn finds them from the apps that use the repository, and the agent needs the right to propose at all of them, not only the one it named; a repository that no deployment runs from is refused, since the change could not be tied to a place. The proposal then reaches the union, so whoever decides it, its facts (is production among them?), the agent's autonomy at each stage and the approvers all cover everywhere it can land. Reading a file for the diff and writing the branch ask for the same right at those deployments, and the one-off capability that carries the change out holds it at the places the proposal names and nowhere else.
The person who asked the agent for the job is recorded from the job itself, never from what the agent says, and cannot approve what the job proposes. A job nobody asked for (an incident's triage) has no asker. A job whose asker cannot be read proposes nothing.
Who decides
POST /remediations/{id}/decision with approve, decline or request_changes.
- It takes
remediation:approveat every deployment the change reaches. - An agent never decides, whatever roles it holds, and the person who asked the agent for the change cannot approve it.
- A proposal is decided once. Two people deciding at the same moment decide it once.
- Declining or asking for changes needs a note, which the agent's track record counts as overruled (declined) so it can learn from it.
- A proposal expires after seven days, or as soon as what it was made against moves (the commit of the base branch, or the snapshot the deployment runs). A stale proposal is ended instead of approved.
One agent can leave at most 50 proposals waiting, so a runaway agent cannot bury the people who decide.
What approving does
Approving hands the proposal to Wardn, which makes the change with its own credentials, never the agent's and never a standing identity of its own: see below.
- Code fix and config change. Wardn pushes the
agent/…branch as one commit on the base branch and opens a pull request, ready for review or as a draft as proposed. The commit and the pull request say who proposed it, who approved it and that nobody merges it but your own review: the provider Wardn writes through has no way to merge, to write to any branch outsideagent/, to force-push or to delete. If the base branch moved since the proposal, nothing is pushed. - Cluster action. A restart goes through the operator, a rollback raises the same release as any rollback (the rules decide it), and a drift revert applies the running snapshot over the named objects. Scaling is not available yet.
- Release steps.
raise_release,advance_waveandrollbackgo through the release use cases.
What was made is stored on the proposal (the branch, the commit, the pull request's address, the release). A failure is stored too, with a plain reason and never the cause. The base is read once more after the approval and before anything is written, so a change that went stale in between is not made. Retrying is safe: a branch that already holds this very change is reused, and a pull request that is already open is returned instead of a second.
What the change runs as
Approving a proposal, by a person or by a rule, queues a durable job that makes the change; it is not done inside the request. The job takes a one-off capability minted for that proposal alone: only that proposal's typed action, at its targets, valid for that one execution and withdrawn when it ends. It is never a standing identity, never a bypass, and it never holds a permission an agent could never hold; guardrails and freezes still apply to what it calls. The audit entry reads "Executed by Wardn under rule R, proposed by agent A" or "Executed by Wardn on the approval of P, proposed by agent A", so who proposed, who or what approved and who made it are three separate facts. The approver's name is recorded, but the change runs with only the proposal's permissions, not the approver's: a person who may approve a restart does not lend the change anything else.
Jobs for one deployment run one at a time, and jobs that write to one branch of a repository do too, so twenty approvals on one deployment are carried out in turn. A failure that retrying could fix (GitHub or the operator is down or limiting calls) is retried with backoff. A worker that dies mid-way has its job resumed by another; the change is safe to repeat because the base is checked again and a branch or pull request that exists is reused. A change that cannot succeed, or one that runs out of attempts, ends as failed with a plain reason. Every call to GitHub goes through a guard with a deadline, a circuit breaker and a limit on calls in flight, so a slow GitHub cannot hold up the server.
States
| State | Meaning |
|---|---|
pending | Waiting for a person, or for the rule that may cover it. |
changes_requested, declined | Decided against, with a note. |
approved | Decided for; the job is queued. |
executing | A worker is making the change, or was and the job will be picked up again. |
executed | Made. The result (pull request, release, action) is on the proposal. |
failed | Could not be made. The reason is on the proposal. |
expired | Went stale, or waited seven days. |
Auto-approve rules
A rule lets a matching proposal run without waiting for a person. POST /remediation-rules takes the duty of editing the rules (remediation:rules), which no agent can ever hold. A rule is for one kind of proposal and can narrow it by cluster action, deployment, environment, repository, file paths (*_test.go, docs/**; every file must match), draft-only and agent, and can carry a limit (an hour or a day, per rule or per deployment). A rule is off until you turn it on.
A proposal is approved by a rule only when all of this holds:
- The agent may act on its own (autonomy
autonomous) at every stage the change reaches. An agent that must be approved is never auto-approved, whatever the rule says. - Wardn could read where the change lands. If it could not, a person decides.
- Nothing on the never auto-approved list applies (
GET /remediation-rules/locked): merging a pull request (there is no such proposal), a ready-for-review pull request to a protected branch, any change to production, anything a guardrail or a freeze holds (any planned or running freeze counts, without working out whose it is), secrets and deleting (there is no such proposal). - An enabled rule matches and has room in its limit. A rule always has a limit, and a rule for code or config names the paths it covers (
*_test.go,docs/**; every file must match one): a rule without either is refused when it is made, and one stored before this was required approves nothing. The limit is checked under a lock on the rule, so five proposals arriving together under a limit of two approve two.
A rule never widens what the change may do: it is carried out under the same one-off capability as any approved proposal, and the proposal records the rule that approved it. A person can still decide any proposal a rule left waiting.
Beyond the list, a rule never covers a change that Wardn judged high-risk, one that touches a CI or deploy file (.github/, .circleci/, .buildkite/, deploy/, Dockerfile, Jenkinsfile, .gitlab-ci.yml), or one that deletes a file. Pushing the branch alone would start CI, so a draft pull request, or one to an unprotected branch, makes no difference.
Previews of a config change
A proposal's files travel in full, old and new, so the review page draws them in its diff view; the list shows only the counts of lines added and removed. A config change carries two previews beside the diff of its files: the rendered diff, which Wardn's own render engine makes by rendering the deployment's app with the proposed file and comparing it with what the deployment runs now, and a dry run against the live cluster. A preview Wardn cannot make says so and why, on the proposal's page as well as here, and a proposal missing either preview is never auto-approved. Today the dry run is not available for a change that has not been applied, so a config change always waits for a person.
In the web app
Open Agents › Remediations. Requests lists every proposal with its number, what kind it is, the repository or deployment it is for, how long it has waited and where it stands. Each row's Risk tag has the reason as its tooltip, and a proposal that waits reads Waiting on you when you may approve it and it waits on a team you are in, or Waiting · Payments when it waits on another team: the team that owns the app of the first deployment it reaches. The chips filter by state and show their counts, including zero. Auto-approve rules is the second tab.
A proposal opens on its own page. Why is what the agent said and what the job it came from reported: how sure it was (a High, Medium or Low confidence chip), its conclusion as a summary line and the links to its evidence. Read job at the top right opens that job. Changes draws each file as a split or unified diff with the lines added and removed, and Tested in the sandbox lists what the agent says it ran (Wardn did not run it). A file over 256 KiB is not drawn: it says "This file is too large to show" and how many lines changed. A config change has Values, Rendered and Both, and says "Preview not available" with the reason when the dry run cannot be made. What approving does and Rules say what Wardn would do and whether a rule could approve it. Approve, Request changes and Decline need remediation:approve; the last two need a comment. Once Wardn has carried it out, the page says what was made, or why it could not be.
Auto-approve rules lists the rules with where each applies, which agents it covers, its limit and its owner, and a switch to turn it on or off. New rule takes remediation:rules. Never auto-approved at the bottom is the list no rule can change.
In the API
| Operation | Needs |
|---|---|
GET /remediations, GET /remediations/{id}, GET /remediations/summary | remediation:read at a deployment the proposal reaches |
POST /remediations/{id}/decision | remediation:approve at every deployment it reaches |
GET /remediation-rules, GET /remediation-rules/locked | remediation:read |
POST, PUT and DELETE /remediation-rules | remediation:rules (no agent can hold it) |
The list carries each proposal's counts of lines added and removed. A proposal's own page carries each changed file whole, old and new (up to 256 KiB a version; beyond that only the counts, with tooLarge set), and the rendered and dry-run previews of a config change.
Agents propose with the propose_remediation MCP tool, which takes the kind and a typed payload; see Agents. An agent can see its own proposals and how they were decided, which is what its track record counts.
What is not built yet
The dry run of a config change is not available, so a config change always waits for a person. A rule that approves a scale only within an autoscaler's limits is not built: the operator refuses to scale a workload an autoscaler drives. Execution is tested only against fakes: a fake GitHub and a fake cluster, not yet the real ones.