Skip to content

Learned-rule candidates: environment label canonicalization and credential screening coverage #117

Open

Description

@github-actions

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Summary

Review of PRs #114, #115 and #116 (independent review threads, each resolved or raised by copilot-pull-request-reviewer) shows two repeated engineering-loop failures that no active learned rule covers. .github/copilot-code-review.yml requires minimumDistinctRuns: 2. Both candidates below meet it with 3 or 2 distinct PRs. The only active rule covers cross-runtime guidance parity. The Agent Rule Review artifact for the latest completed run (43024419099) contained no candidate report, so this evidence comes from PR review threads.

Candidate 1: Canonicalize environment and scope labels in one shared helper

Pattern: environment or scope labels are compared with ad-hoc, partial normalization, so conflicting or valid values slip through or throw.

Proposed rule: Any code that selects, compares, or authorizes by environment or scope (hostname labels, path labels, profile environments in array or object form, post.<env> keys) must use the shared case-insensitive canonicalization and tokenization (dot, slash, hyphen, underscore; development → DEV). Add regression cases for mixed case, separators, aliases, and both profile shapes.

Candidate 2: Screen credentials on every path that persists, forwards, or displays free text

Pattern: a credential filter is added at one boundary and bypassed at a sibling boundary or through encoding.

Proposed rule: When adding or changing credential screening, route every ingress and egress of untrusted free text (prompts, summaries, logs, terminal forwarding, persisted results, titles, details, and choices) through one shared screen applied to the original unescaped string before it is stored, forwarded, or displayed. Regression tests must cover labeled, natural-language, header-setter/tuple, and escaped forms, plus safe diagnostic mentions such as "password reset test fails".

Why existing rules do not cover them

The sole active rule ("Mirror cross-runtime guidance in every execution entry point") addresses parity across runtimes and agent sources, not label canonicalization or credential-screening coverage.

Validation or retirement condition

Promote after human review. Retire after 10 consecutive qualifying PRs touching environment/scope handling or free-text credential screening produce no reviewer finding of the same class (per retirement.minimumCleanRuns).

Security and compatibility risk

Both rules are security-protective and should not widen access. Risks: over-strict credential matching can reject safe diagnostics (mitigated by the required safe-mention regressions) and canonicalization may reject previously accepted ambiguous bases. Evidence contains no credentials, private data, or endpoints. Promotion or retirement must go through a pull request; no source was modified.

Generated by Review FixLab learned-rule candidates · copilot · auto · 25.5 AIC · ⊞ 4K · ◷

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions