What to build
Broaden the path scope of @file references beyond CWD, and add the security boundary that keeps the broader scope safe.
Behavior:
- Accept absolute paths (
@/abs/path) and ~ expansion (@~/notes/foo.md).
- Canonicalize the resolved path (follow symlinks) before any further check.
- Enforce a compiled-in deny-list against the canonical path.
- Deny-list check runs before the size cap, so a huge deny-listed file errors as sensitive-path rather than too-large. Prevents a size-based oracle.
Deny-list patterns (compiled into the binary, changing them is a code change with a test):
~/.adapt/config.toml
~/.ssh/*
**/.env*
**/id_rsa*
**/*.pem
**/.aws/credentials
**/.gnupg/*
Acceptance criteria
Blocked by
What to build
Broaden the path scope of
@filereferences beyond CWD, and add the security boundary that keeps the broader scope safe.Behavior:
@/abs/path) and~expansion (@~/notes/foo.md).Deny-list patterns (compiled into the binary, changing them is a code change with a test):
~/.adapt/config.toml~/.ssh/***/.env***/id_rsa***/*.pem**/.aws/credentials**/.gnupg/*Acceptance criteria
@/abs/path/to/file.mdresolves correctly@~/notes/foo.mdexpands~to the user's home directory~/.ssh/id_rsais refused with the deny-list error, not the CWD-escape errorrefused @path: matches sensitive-path deny-listBlocked by