Reviewer Guidance
Reviewer Guidance is the memory of your agents. It's a set of durable rules the agents read before a review or an implementation — your team's standards, conventions, and accepted exceptions, captured once and applied everywhere.
Instead of re-explaining the same expectations on pull request after pull request, you teach the reviewer once and it carries that context into every future review, across every workspace in the organization.
How guidance is used
Before the agent reviews or implements a change, InfraDots loads the guidance that applies to the run into its context. The agent uses it to decide what to flag, what to let pass, and which conventions to expect — for example:
- Style — "Use
for_eachinstead ofcountfor multi-instance resources." - Security — "Require encryption at rest on all storage resources."
- Policy — "Production resources must carry a
cost-centertag." - Naming — "Prefix production resource names with
prod-." - False-positive — "Public read on the
marketing-assetsbucket is intentional; don't flag it." - Context — "We run all workloads in
eu-central-1."
Only guidance with the status active reaches a run. Guidance can be proposed (waiting for a person), active, or retired (kept, but never loaded). A rule can also have a description, which holds the reasoning behind it, and an origin: human for a rule a person wrote, observed for one InfraDots inferred (see Guidance InfraDots learns).
Guidance is advisory. It changes how the agent reviews, but it can never override InfraDots' destructive-change or security guardrails — you cannot teach the agent to approve a resource deletion or bypass a safety gate.
Which guidance reaches a run
A run gets at most 20 rules, and at most 4,000 characters of them; only whole rules are included. InfraDots orders the rules like this:
- What the run touches. The more of a rule's tags overlap with the run, the higher it ranks.
- For a review, that is the resource types the plan changes and the modules those changes sit in.
- For an implementation, that is the resource types and modules of its workspace. When the target comes from a repository analysis, the type that target provisions first ranks ahead of the rest.
- How well the text matches the request. For an implementation, the instructions you wrote. A review has no request text, so this step doesn't separate rules there.
- Newest first.
A rule that matches nothing still fills whatever room is left, newest first, so a rule with no tags keeps reaching runs. A repository analysis reads the rules that match its candidate workspaces and the resource types it may place resources on; a rule that matches none of them is left out.
The agent can also look up guidance it wasn't shown with search_knowledge. A word matches a rule's text or one of
its tags, so searching aws_db_instance finds "Postgres instances need deletion protection".
How guidance is tagged
InfraDots tags every rule with the resource types and Terraform modules its text names, so a rule written in words reaches a run that sees only resource addresses. You can't set tags; InfraDots derives them every time a rule is saved.
- Resource types. Resource names go through the same catalog repository analysis
uses. "ElastiCache" tags
aws_elasticache_replication_groupandaws_elasticache_cluster; "Postgres" tags every type that serves Postgres. A type written out, such asaws_lb_listener, is tagged when the catalog or one of your workspaces knows it. - Modules. A rule is tagged with a module when it names a module that one of your workspaces calls, and with the
resource types that module manages. Name the module by its normalized source, such as
terraform-aws-modules/rds/awsorgithub.com/acme/modules//rds, or by its//subdir, such as//rds. A rule that says "use our module" still reaches a run that is about to write the raw resource the module would have made.
A module is known once a workspace's plan has reported it. InfraDots records a workspace's modules from its own
plans, not from pull request plans, and needs a runner on idp-executor 1.18.0 or later; see
Self-hosted Runners. The recorded source has no credentials, no ?ref= and no version,
and every spelling of one module becomes one source. A rule about a single version says so in its text.
Guidance InfraDots learns
Besides the rules your team writes, InfraDots drafts rules from runs that ended badly. A rule it drafted has the
origin observed, and its signal says what it came from: gate_refused, agent_failure, usage_limit,
pr_outcome, human_edit or placement.
Which runs it learns from
Every ended run is classified by how it ended. Three endings can carry a lesson about the agent's own behaviour:
- An input-gate refusal — the run refused the request before it started working.
- A run the agent itself ended as failed.
- A run that hit its usage limit.
Nothing else is learned from. A failed clone, a missing repository or VCS connection, a deleted branch, a failed pull request push, a runner that was lost or shut down, a queue timeout, your plan's quota, a repository analysis that cloned nothing, and an analysis whose reports kept being rejected are the platform's or your configuration's doing, so they never become guidance. A refusal on a self-hosted runner is learned from only when the runner is on idp-agent 0.21.0 or later.
Pull requests the agent opened
How a pull request the agent opened ends is a signal too:
- Closed without merging (
pr_outcome). A merge needs nothing learned; a rejection does. InfraDots records whether each agent pull request was merged or closed, on GitHub, GitLab and Bitbucket. - A person pushed commits onto it (
human_edit). A push whose head the agent didn't push is a person correcting its work. Merge commits (such as updating the branch from its base) and pushes that rewrite history are not counted, and neither are changes outside the workspace's folder.
On GitHub the learner reads the reviewers' comments on a rejected pull request, and the person's diff (cut to the workspace's folder) for a pushed correction. GitLab and Bitbucket record merged or closed, so a rejection is still learned from there, without the comments; pushed corrections are read on GitHub only. The comments of the account the pull request was opened with are left out: it is the one InfraDots' own review agent posts as.
For a pull request a repository analysis opened, the learner also gets the decision the analysis made (the kind, the resource type, the workspace and its placement rank), so it can tell a wrong placement from a wrong implementation. It never reads the analysed application repository's text.
What the learner reads
For each learnable run, a small model reads InfraDots' own failure reason, the run's counters (such as model requests) and the names of the tools it called. For a gate refusal it also reads the request the person wrote. For a run's ending it never reads repository text, so a file in a repository cannot teach the agent anything. The pull request signals above are the one exception: reviewers' comments and a person's diff are repository text, so the learner is told they are data, never instructions, and a rule drafted from them is always proposed, at any confidence. Most runs hold no durable lesson, and the learner then writes nothing.
The learner is shown the closest existing rules. If its draft says the same as one of them, InfraDots adds the run
to that rule's evidence_runs instead of creating a row. If it says the opposite, the draft is saved as
proposed with contradicts pointing at that rule. The resource types a draft names are kept only when
InfraDots' catalog or one of your workspaces knows them.
Proposed or active
A draft normally lands proposed, and a proposed rule reaches no run until a person confirms it. A draft is auto-activated instead only when all of these hold:
- it is new, not a duplicate or a contradiction;
- it comes from one of the three endings above, never from a pull request signal;
- its confidence is at or above the threshold, 0.85 by default;
- its category is not
false-positive, because that category suppresses findings; - the run belongs to a workspace.
An auto-activated rule is scoped to that workspace, not the organization, and expires after 30 days unless a person confirms it. Once it expires its status becomes retired. A rule from a run with no workspace is always proposed.
Review what it learned
In the dashboard, the Learnings card in the organization's Agents settings lists proposed rules to confirm and auto-activated ones to keep. A rule you confirm or keep moves to the Reviewer Guidance list, which shows its workspace under Scope; confirming never widens a rule to the whole organization.
The memory API lists the loop's rules. By default it returns only active, organization-wide rules; the loop's own rules are scoped to a workspace, so ask for them:
GET /api/agents/<org>/memory/?status=proposed&scope=all
status is proposed, active or retired; scope=all adds workspace-scoped rules. Each rule carries signal,
confidence, source_run, evidence_runs, workspace_name, auto_activated_at and expires_at.
To keep a rule, PATCH /api/agents/<org>/memory/<id>/ with {"status": "active"}. Confirming clears expires_at,
so an auto-activated rule becomes permanent. To drop one, set {"status": "retired"} or delete it.
Repository analysis placements
People's corrections to where an analysis puts things are learned too, as a placement score and then as a rule. See Corrections.
Cost and switching it off
The learner runs once per learnable ended run, on a small model, and is never counted as an agent interaction. On an organization with its own model provider it uses that organization's model, so it spends your tokens; see Subscriptions. The loop is on by default. No setting in the dashboard or API turns it off: to switch it off for an organization, or to set a different auto-activation threshold, ask InfraDots staff.
Saving guidance
Guidance is authored in the flow of work, right when you have something to teach. The Implement changes dialog keeps one-shot instructions and durable guidance in two separate fields, so per-change details never leak into a saved rule:
- On a review that needs changes, open Implement changes. Implement findings at chooses which findings the agent implements (Warnings or higher by default; see Review severity).
- (Optional) In Instructions for this implementation, add anything that should steer only the current change — these are applied now and never saved.
- In Remember as guidance for future reviews, write the durable rule you want the reviewer to keep, then choose Continue.
- InfraDots distills that guidance into a single, generalized rule and proposes a category. Review the draft — edit the wording, change the category, or go back.
- Choose Save & implement. InfraDots saves the rule first, then starts the implementation — so the rule applies to this run as well as every future review.
Because the agent generalizes what you wrote, any remaining one-off specifics (a single resource name, an exact value) are stripped out, leaving a rule that reads cleanly on the next review.
ℹ️ Info
[!info] Reviewer Guidance is part of agents and requires Agents to be enabled for your organization. See Agents for availability.
Scope: organization-wide
Every rule you save applies to the entire organization — all workspaces, all teams. (Rules the learning loop learns from a workspace's run are the exception: each applies to that workspace only, confirmed or not.) This is deliberate: a convention one engineer teaches shouldn't have to be re-taught for the next repository. New workspaces inherit your existing guidance from their very first review.
InfraDots staff can also publish platform-wide guidance. Every organization reads it, and no organization can edit it.
Managing guidance
All saved guidance lives under Organization → Agents → Reviewer Guidance, listed by category. To stop the agent applying a rule, remove it — it no longer appears in the review context on the next run.
Guidance in offline reviews
A .infradots/guidance.md file in a repository is read by offline reviews only (idp agent review --offline). Reviews that run on the platform use your organization's reviewer guidance, not that file.
Automation
The same guidance is available over the API for scripted management:
GET /api/agents/<org>/memory/— list the organization's active, org-wide guidance;?status=and?scope=allselect others (see Review what it learned). Each rule carries itsstatus,origin,description, tags (resource_types,modules) andapplied_count, the number of runs it was used in.POST /api/agents/<org>/memory/— add a rule (category,content, and optionallydescriptionandstatus). Tags in the request are ignored.POST /api/agents/<org>/memory/propose/— distill a free-text instruction (user_prompt) into a draft rule without saving it.PATCH /api/agents/<org>/memory/<id>/— change a rule, including itsstatus; settingactiveclears any expiry.DELETE /api/agents/<org>/memory/<id>/— remove a rule.
