Skip to content

Tighten research agent permissions and a few label server paths - #723

Merged
wagoodman-anchore merged 5 commits into
mainfrom
research-and-claims-hardening
Oct 29, 2026
Merged

wagoodman-anchore merged 5 commits into
mainfrom
research-and-claims-hardening

Conversation

@wagoodman

@wagoodman wagoodman commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
  • Scope reads for the researcher to the workspace (by absolute path in the default command, like its Edit rule), and the command denies reads of home dot files/dirs and ~/Library, which wins over any allow and covers Grep and Glob too. It's a denylist, not a full fence: other paths outside the workspace are still readable if a person's settings allow it

  • smaller things:

    • pairing dedupes a match's ids with a set and sorts once instead of per id
    • the label server's view stamp skips dot dirs (.git) in local claims sources
    • GET /api/research/{id}/log?raw=1 streams the file instead of reading it whole
    • YARDSTICK_CACHE_DIR gets a named constant next to YARDSTICK_CLAIMS_URL, with a note on why both stay env vars rather than clio options

@wagoodman wagoodman self-assigned this Oct 29, 2026
@wagoodman
wagoodman force-pushed the research-and-claims-hardening branch from 581fbd8 to 7707177 Compare October 29, 2026 16:15
- the default research command and the research-vuln skill's allowed-tools granted bare `Read`, `Grep` and `Glob`, so the agent could read files anywhere rather than just the workspace it's working in
- the command's read rules now name the workspace by absolute path, like its `Edit` rule (`Read(/$YARDSTICK_ROOT/**)` and so on); the skill's frontmatter can't name the workspace, so it scopes them to `./**`
- a person's own settings may allow `Read` more broadly, so the command also passes `--settings` with `blockReadsOutsideWorkingDirectories`, which keeps `Read`, `Grep`, `Glob` and shell reads inside the working directories regardless of allow rules (needs Claude Code v2.1.257+)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- `union` scanned the slice for every id it added and callers fed it one related id at a time, sorting after each, so a match with many aliases was quadratic
- it now takes every id at once, dedupes with a set and sorts once; the result is the same

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- the label server re-stamps a gate's view on every request by walking each local claims source, `.git` included, which a corpus never reads and which can hold far more files than the labels
- dot directories are skipped, as corpus validation already does

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- `GET /api/research/{id}/log?raw=1` read the whole log into memory on every call; it's copied from the file now, with the same plain text and nosniff headers

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- `YARDSTICK_CACHE_DIR` and `YARDSTICK_CLAIMS_URL` are the two `YARDSTICK_*` settings read with `os.Getenv` rather than bound by clio
- moving them onto clio isn't modest: clio has no app-wide option besides logging, so each would have to be added to every command that reaches the cache or a remote claims source, and re-exported to the research agent and the plugin's scripts, which read them from the environment today
- so the cache's variable gets a `DirVar` constant beside `claims.URLVar`, with that reasoning, and nothing else changes

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman
wagoodman force-pushed the research-and-claims-hardening branch from 7707177 to 713229a Compare October 29, 2026 20:42
@wagoodman-anchore
wagoodman-anchore merged commit c206e6c into main Oct 29, 2026
15 checks passed
@wagoodman-anchore
wagoodman-anchore deleted the research-and-claims-hardening branch October 29, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants