Skip to content

Use secrets in conversations - #113

Merged
nishu-builder merged 3 commits into
mainfrom
codex/conversation-secrets
Aug 20, 2026
Merged

Use secrets in conversations#113
nishu-builder merged 3 commits into
mainfrom
codex/conversation-secrets

Conversation

@nishu-builder

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

Copy link
Copy Markdown
Contributor

Summary

  • load the git-ignored, per-device .caos-secrets store for TUI, talk, and chat conversation work
  • carry secret values and entropy only in ephemeral client-to-server request context; only the entropy-derived secret-hash enters ArgTrees
  • use the server-owned sub-run primitive from Preserve run context for detached sub-runs #122 for detached subagent conversations, preserving the parent stack and complete server-side secret store without delegating secret material through workers
  • share secret parsing and request execution across CLI conversation paths

Dependency

This PR stacks directly on #122. That PR replaces worker-side run-async with sub-run: the worker sends only the prepared child request and its short-lived parent job nonce, and the server recovers the in-flight parent context before starting the detached child.

Constrained reader arguments are intentionally separate in #121. This PR continues to use the existing path-only reader syntax.

Configuration

# .gitignore
.caos-secrets/

# .caos-secrets/anthropic-api-key
name=anthropic-api-key
value:@=/absolute/path/to/anthropic-api-key
reader=DEEP-DEPS/llm-step
reader=DEEP-DEPS/llm-call

caos-cli secrets creates the random entropy= used for cache isolation.

Security model

The raw secret value and entropy do not enter an ArgTree, cache key, curry, worker image, runner payload, or Git object. The server holds them in ephemeral run context and injects a value only when the concrete worker request contains a configured reader ArgTree and the matching secret-hash.

A subagent child is authorized independently against its actual request. The child keeps the identity-bearing run-and-update-ref-image argument so it remains a superset of the configured llm-step reader; a separate subagent=true marker disables nested subagents. No delegated-secret field, header, or serialized grant remains.

Validation

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

@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from d2a2261 to fb6f518 Compare August 19, 2026 21:31
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 75c1b6c to 8e19db9 Compare August 19, 2026 23:58
@nishu-builder
nishu-builder changed the base branch from main to codex/constrained-secret-readers August 19, 2026 23:58
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 8e19db9 to cc41fd0 Compare August 20, 2026 00:36
@nishu-builder
nishu-builder changed the base branch from codex/constrained-secret-readers to codex/sub-run August 20, 2026 16:29
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 269b79d to 8e2bfab Compare August 20, 2026 18:34
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 8e2bfab to 398e0cb Compare August 20, 2026 18:52
Base automatically changed from codex/sub-run to main August 20, 2026 20:08
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 398e0cb to 1670ca7 Compare August 20, 2026 20:08
@nishu-builder
nishu-builder force-pushed the codex/conversation-secrets branch from 1670ca7 to ba030a3 Compare August 20, 2026 21:08
@nishu-builder
nishu-builder merged commit fe8ede4 into main Aug 20, 2026
1 check passed
@nishu-builder
nishu-builder deleted the codex/conversation-secrets branch August 20, 2026 21:37
malcolmredheron added a commit that referenced this pull request Aug 20, 2026
Drops nothing of ours. The only conflict was an import list in
`std/llm-step/src/main.rs` — our side added `eval_then_catching`, main's added
`secret` — resolved by taking both.

`Fix TUI clippy regression (#133)` supersedes the `#[allow]` reverted in
a1ddfbd: it takes `SubmitMessagePolicy` where the function was taking
`require_absent`/`proposal` loose and packing them into that struct two lines
later. Seven arguments, no suppression. A suppression that outlives its cause
is worse than none — the next reader takes it to mean "these arguments travel
together" when one of them was two arguments wearing a trenchcoat.

Also arriving: `Use secrets in conversations (#113)` and `Guide TUI users
through secret setup (#131)`, which move the secret store this branch threads
through `ClientEvalHost::mark_curry` and the eval memo key — worth the full
gate rather than an assumption.

Verified on the merged tree: nix build, lint-flake-src.sh, cargo
build/clippy/fmt/test, `cargo doc -D warnings`, and
`CAOS_SALT=$(date --iso=s) run-tool test` — 45/45.
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