Skip to content

Constrain secret readers with curry arguments - #121

Open
nishu-builder wants to merge 1 commit into
mainfrom
codex/constrained-secret-readers
Open

Constrain secret readers with curry arguments#121
nishu-builder wants to merge 1 commit into
mainfrom
codex/constrained-secret-readers

Conversation

@nishu-builder

@nishu-builder nishu-builder commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require every .caos-secrets reader= line to contain an explicit typed --base
  • treat the field value as the same typed argument list accepted after curry; reader= denotes assembly, so there is no curry token on the line
  • reuse the existing expression parser and ArgTree assembly, including pinned-tree :@= resolution
  • assemble and unwrap readers into the existing partial name-to-OID map without executing the resulting request
  • remove the old path-only shorthand and migrate repository fixtures and documentation
  • update the TUI missing-secret guidance to print the required typed reader bases
  • keep the server-side subset matcher and secret injection model unchanged

This PR is deliberately generic: it does not change llm-step, llm-call, conversation request construction, or Anthropic defaults. The LLM fixtures are changed only to use the required explicit reader base.

Why

Path-only readers constrain worker identity but leave every additional argument unconstrained. Secret owners need to pin local grant policy such as an allowed destination, repository, or environment without creating repository-owned wrapper expressions.

This restores inline reader constraints removed in 91866bd94: content-addressed worker identity belongs in the source tree, while the secret owner's local constraints belong with the per-device secret grant.

Syntax

reader=--base:@=DEEP-DEPS/github-push --repo=github.com/me/project

Each reader= is one independent partial ArgTree. Missing, duplicate, rebound, malformed, untyped, and unsuitable bases fail clearly. Secret values and entropy remain out of ArgTrees; only the existing entropy-derived secret-hash enters them.

Security coverage

  • exact pinned constraints grant the secret
  • changing a pinned constraint denies it
  • copied or forged secret-hash values cannot bypass a mismatch
  • extra unpinned arguments still match
  • multiple readers retain independent bases and constraints
  • path and hash forms resolve with ordinary curry OID identity
  • malformed and obsolete reader forms fail closed

Dependency

This PR is one commit on top of current main, which contains #113. It does not alter #113's sub-run conversation design; it only changes reader parsing and migrates reader declarations to the explicit-base grammar.

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace
  • nix build
  • fresh salted CAOS_SALT=$(date --iso=s) result/bin/caos-cli run-tool test: 45/45 passed, including secrets and sub-run
  • git diff --check

@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch from e4de2c7 to f7c80c3 Compare August 20, 2026 00:36
@nishu-builder
nishu-builder deleted the codex/constrained-secret-readers branch August 20, 2026 17:56
@nishu-builder nishu-builder reopened this Aug 20, 2026
@nishu-builder
nishu-builder changed the base branch from main to codex/conversation-secrets August 20, 2026 18:35
@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch 2 times, most recently from 6e28c12 to 3647249 Compare August 20, 2026 18:44
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 8e2bfab to 398e0cb Compare August 20, 2026 18:52
@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch from 3647249 to 18a5c1d Compare August 20, 2026 18:52
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch 2 times, most recently from 1670ca7 to ba030a3 Compare August 20, 2026 21:08
@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch from 18a5c1d to 459ae0c Compare August 20, 2026 21:08
Base automatically changed from codex/conversation-secrets to main August 20, 2026 21:37
@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch 2 times, most recently from 33fd957 to 0ea0e80 Compare August 20, 2026 22:45
@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch from 0ea0e80 to 5d8f6f4 Compare August 21, 2026 00:48
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.

1 participant