Skip to content

feat(tools): built-in /attach and /architecture file tools with safety gates #933

Description

@adolfousier

Context

QoL suggestion (via MoneyAcademyKE): a VSCode-style explorer so you can browse and preview files from chat, fully away from keyboard. Refined with Adolfo into two focused surfaces:

  • /attach — browse and preview docs (.md plus docs dirs). Tap a folder to drill in, tap a file to preview it inline, then the agent edits on request.
  • /architecture — expose the structure of the repo. Bare invocation shows the current path; otherwise pick a dir and render the tree.

Decision: built-in tools, not skills

These touch the filesystem, so the safety gates must be deterministic compiled code, not an LLM-interpreted skill. A skill can drift or be nudged into reading something it should not; a built-in tool enforces the allowlist/denylist mechanically. Precedent: #242, where the /cd directory browser was usable by any allowlisted channel user, not just the owner.

Security requirements (hard)

  • Owner/admin-only. Never exposed to arbitrary allowlisted members.
  • /attach is docs-only allowlist: .md and docs directories. Hidden files and dirs excluded. Non-doc files are not surfaced.
  • Secrets denylist on any path resolution: ~/.ssh, *.pem, *.key, .env*, keys.toml, config.toml, and anything secret-shaped. Refuse and say why, never silently skip.
  • /architecture lists directory names only, excluding .git, node_modules, target, vendor dirs, and hidden entries, so structure output is useful and low-sensitivity.
  • Previewing puts content in the chat log, which is why /attach stays docs-only by default.

Proposed behavior

Surface Behavior
/attach glob docs in the workspace, tap-to-navigate folders, tap-to-preview a file inline, agent edits on request
/architecture current-path tree by default, depth-limited, tap to drill into a subdir

Acceptance criteria

  • Both surfaces are compiled/built-in with the gates enforced in code, not prompt text.
  • Hidden files and secrets are unreachable through either surface.
  • Gated to owner/admin; a non-owner invocation is refused.
  • Works channel-agnostically (Telegram first, then Discord/Slack/WhatsApp).

Related

Activity

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

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions