Skip to content

Config self-protection: block agent writes to ~/.config/failsafe/config.yaml #12

Description

@Tombar

The koanf config spec promised a self-protection rule that never shipped: a bundled-policy rule in internal/embed/policies/failsafe.rego blocking agent writes to ~/.config/failsafe/config.yaml, plus a corpus case covering it.

Without it, an agent can edit the guard's own config (e.g. point log.path somewhere useless or prepare control_plane.* keys) with no policy pushback. The dangerous knobs were already removed (mode.default, log.redact fixed true), so severity is contained — but the config file is still the guard's own attack surface and should be inside the protection boundary.

Scope:

  • failsafe.rego rule blocking writes/redirection targeting ~/.config/failsafe/config.yaml (echo/tee/cp/mv/sed -i …)
  • corpus fixture(s) under internal/corpus exercising the block
  • doc note in docs/reference/configuration.md

Pairs with the fs-guard roadmap note from 8022a86 (config: telemetry stub, configuration docs, self-protection note).

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