Skip to content

Encode Trust Boundaries So Hardening Effort Follows the Real Threat, Not the Maintainer's Own Inputs #2501

Closed

Description

@ptr727

Problem

Agents and the review bot apply the same adversarial hardening to every input, whether the input comes from an outside attacker or from the maintainer. Effort is spent defending against threats that cannot happen, and each review round generates more of it.

The maintainer has corrected this repeatedly, and so far the correction lives only in per-repo session memory, which does not carry between repositories or sessions. Two recent examples:

  • Blog. The maintainer hands a session an image to process, and the session files a run of image-parser hardening issues as though the image were hostile upload content. The maintainer has asked the Blog sessions to stop many times.
  • HomeAutomation-Config. A healthcheck change that reads docker and cscli output back from the maintainer's own VPS went through an adversarial review brief that treated that output as hostile. The result filters the text, quotes only a fixed status vocabulary, and adds a test case proving that hostile text is not quoted. The VPS is not an attacker, so none of that defends against anything real.

Hub-side, the same pattern shows up in issues that harden the guard against command shapes no real session produces. Re-ranking those is out of scope here. The rule below gives every session, and the reviewer, a way to tell the difference.

Proposed rule

A GOVERNANCE.md section, carried fleet-wide and packaged as a skill or folded into agent-conduct / fleet-code-review / pr-review-conduct. Proposed working title: "Trust Boundaries and Hardening Effort".

  1. Every input belongs to one of two classes, and the class decides the effort.
    • Trusted: the maintainer and what the maintainer controls. Files, images, and data the maintainer hands a session. Settings and secrets files the maintainer writes. CLI arguments. The repository's own content and the hub's. The maintainer's own hosts, and the output read back from them over SSH or a local command. State files the repository's own scripts write.
    • Untrusted: what arrives from outside. Requests from internet clients and every field they control (headers, paths, bodies, the access-log lines they produce). Upstream release metadata and downloads that end up in a config file or a command line. Third-party API responses. Content from outside contributors. Bot-generated pull requests.
  2. For trusted input, the only threat is a maintainer mistake. Guard against the realistic mistake (a typo, CRLF line endings, a missing file, a wrong unit) only where it would fail silently or destructively. Use one check at the point of read with a clear message, centralized rather than repeated per site. Do not build parsers for adversarial shapes, test injection through a trusted file, filter text read back from the maintainer's own hosts, or file issues for hypothetical attacks on trusted input.
  3. For untrusted input, validate at the boundary where it enters, once, proportionate to what it can reach.
  4. Effort follows likelihood times consequence. A finding about an impossible or non-exploitable case gets declined, not fixed and not filed. A finding about an unlikely mistake with a loud failure gets declined too. A finding is worth a fix PR or an issue only where the case can actually occur and its failure would be silent or destructive.
  5. A review finding asking for hardening against a trusted input is declined, citing this section, with no fix PR and no issue. This goes into .github/copilot-instructions.md too, so the reviewer stops raising these findings rather than sessions declining them every round.
  6. Each repository names its own boundaries. A short list in its own operations doc (for example OPERATIONS.md) naming which concrete inputs are trusted and which are not, so a session or reviewer applies the rule without re-deriving it. A repository whose list is missing defaults to the classes in point 1.

Done when

  • The section is in hub GOVERNANCE.md and routed from the AGENTS.md table.
  • A skill surfaces it at the decision moments: briefing a review, triaging a finding, and about to file a hardening issue.
  • .github/copilot-instructions.md carries the reviewer half (point 5).
  • The carried change reaches the fleet on the next resync.

Filed from a HomeAutomation-Config session at the maintainer's request.

🤖 Generated with Claude Code

Activity

  1. ptr727 commented on Oct 7, 2026

    @ptr727
    OwnerAuthor

    Decision on the form: a governance rule, surfaced through the existing skills, not a new skill

    The maintainer left the choice to the session working #2493, and this is it.

    • Home. A GOVERNANCE.md section, routed from the AGENTS.md table. It binds every session and the reviewer at once, so it is law rather than a procedure. A standalone skill would be one more surface stating the same rule, and a skill only fires where its trigger matches.
    • Surfacing. Carry it as a generated include in fleet-code-review "Review the Change". That section is already where local-strict-review and pr-review-conduct take their review criteria, so every review brief and every triage reaches the rule with no new trigger. pr-review-conduct's decline outcome cites it for a finding against a trusted input or a negligible-likelihood case.
    • Reviewer half. .github/copilot-instructions.md carries point 5, as proposed.

    Widen point 4 beyond trust boundaries

    Likelihood times consequence should govern robustness hardening as well as untrusted input. #2493 shows the cost. local-strict-review's brief tells the reviewer to "flag TOCTOU/race conditions" unconditionally. On a single-user host installer, that produced seven review passes. They hardened the installer against concurrent writers swapping files mid-cleanup, Ctrl-C arriving while a close also fails, and Windows file-identity differences. Then #2494, #2498 and #2499 were filed, all for cases with no realistic path to occur.

    So the change should also do two things:

    • Make the strict-review brief's race, coercion and platform lines conditional on the case being able to occur in the code's actual deployment, a single-user host tool being the common one.
    • Give the agent's own triage the same decline: a finding about a case that cannot realistically occur is declined with the reason, not fixed and not filed.

    Once this lands, re-triage #2494, #2498 and #2499 against it.

  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Landed in #2507 (develop, 6ccffa8), closing with the promotion to main. One deliberate deviation from the plan above, confirmed by the maintainer: .github/copilot-instructions.md is unchanged. Copilot loads fleet-code-review, whose "Review the Change" now carries the whole section as a generated include, and that file forbids duplicating GOVERNANCE.md, so a reviewer-half sentence there would be a second surface stating the same rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions