Skip to content

[bug] apm install integrates files in .github/instructions/ that are not produced by an installed plugin #1199

@danielmeppiel

Description

@danielmeppiel

Summary

When a file is dropped directly into .github/instructions/ (not produced by any installed plugin), apm install appears to integrate it as if it were a managed primitive. The subsequent unmanaged-files policy check then reports zero unmanaged files, because everything in the monitored directory is treated as managed.

Repro

Starting from a project with installed plugins:

cat > .github/instructions/hand-rolled.instructions.md <<'INSTR'
---
applyTo: "**"
description: "Hand-rolled, not from any plugin"
---
hello
INSTR
apm install

Install logs include a line like instructions/: ..., hand-rolled.instructions.md. The file is now treated as integrated.

Then:

apm audit --ci --policy <some-policy-with-unmanaged_files-deny>

unmanaged-files reports clean. The hand-rolled file evades the governance check that the policy is meant to enforce.

Expected

apm install should only deploy files that originate from declared plugin manifests. Files that pre-exist in monitored governance directories without provenance should be:

  • left untouched (not "integrated" into the managed set), and
  • visible to unmanaged-files audit when the policy declares action: deny.

Workaround

For the demo we used in this report we routed the unmanaged file to .github/hooks/ instead, which apm install does NOT touch. That correctly trips the audit, but it also reveals the asymmetry: the same content rule applies to all three monitored directories per policy spec, but only one of them is actually enforceable today.

Impact

A consumer can side-step org policy unmanaged_files: action: deny by simply placing instruction files at the right path before installing — apm install will adopt them silently and policy will treat them as managed.

Related

Filed alongside #1198 (extends: silently downgrades unmanaged_files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/audit-policyapm-policy.yml schema, custom_checks, install-time enforcement.area/content-securityUnicode scanning, Glassworm, apm audit content checks, SARIF output.priority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions