Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

2.0 KB
Raw Blame
id: shell-login-dotfile-modified
version: 2
title: Shell rc / login dotfile modified
description: >
  The agent modified a shell startup or login dotfile (.bashrc, .bash_profile,
  .profile, .zshrc, .zprofile, .zshenv, .kshrc, .login, or fish config.fish).
  These run on every new shell or login session, outside any agent sandbox, so an
  edit here is durable user-level persistence (e.g. an injected command, alias, or
  PATH change).
severity: high
status: stable
posture: detect
taxonomy:
  beacon_category: sensitive-edit
  owasp_llm: LLM05
  mitre_atlas: AML.T0011

match: >
  e.event.action in ["file.modified", "file.created", "file.edited"] &&
  e.file.path.matches("(?i)(^|/)(\\.bashrc|\\.bash_profile|\\.bash_login|\\.profile|\\.zshrc|\\.zprofile|\\.zshenv|\\.zlogin|\\.kshrc|\\.login|\\.cshrc|\\.tcshrc)$|(?i)(^|/)\\.config/fish/config\\.fish$")

emit:
  reason: "Shell rc / login dotfile modified — runs on every new shell/login, durable user-level persistence"

tests:
  - name: bashrc_edit
    verdict: match
    events:
      - event: { action: file.modified }
        file: { path: "/home/dev/.bashrc" }
        session: { id: s1 }
  - name: zprofile_edit
    verdict: match
    events:
      - event: { action: file.modified }
        file: { path: ".zprofile" }
        session: { id: s1 }
  - name: fish_config_edit
    verdict: match
    events:
      - event: { action: file.modified }
        file: { path: "/home/dev/.config/fish/config.fish" }
        session: { id: s1 }
  - name: ordinary_config_edit
    verdict: no_match
    events:
      - event: { action: file.modified }
        file: { path: ".eslintrc.json" }
        session: { id: s1 }
  - name: profile_read_only
    verdict: no_match
    events:
      - event: { action: file.read }
        file: { path: ".profile" }
        session: { id: s1 }
  - name: bashrc_edit_created
    verdict: match
    events:
      - event: { action: file.created }
        file: { path: "/home/dev/.bashrc" }
        session: { id: s1 }