Docs/Reference

Reference

Credential stores are never copied: block-credential-copies

A gate on the shell and on the tools that write files (tama hook block-credential-copies) that refuses a command, or a source file a write leaves, that copies a harness's credential store. An OAuth refresh token is spent when it is used: a process that refreshes an account from a copy of the store voids the token the original holds, and every account the copy carried stops signing in wherever the original is used. A test that ran a harness on a copied store signs its operator out of all his accounts each time it runs.

A gate on the shell and on the tools that write files (tama hook block-credential-copies) that refuses a command, or a source file a write leaves, that copies a harness's credential store. An OAuth refresh token is spent when it is used: a process that refreshes an account from a copy of the store voids the token the original holds, and every account the copy carried stops signing in wherever the original is used. A test that ran a harness on a copied store signs its operator out of all his accounts each time it runs.

#What it reads

The stores and the copies are declared in block_credential_copies/stores.json:

StoresCopies
OMP's ~/.omp/agent/agent.db, Claude Code's ~/.claude/.credentials.json, Codex's ~/.codex/auth.json, Jeden's ~/.jeden/model-tokens.sqlite3, GitHub CLI's ~/.config/gh/hosts.yml VACUUM INTO, a SQLite .backup(, fs::copy, copyFile, shutil.copy, cp, rsync, ditto

A statement copies a store when it names both a store and a copy, or when it copies a name an earlier statement bound to a store (let store = home.join("…/agent.db"), then fs::copy(&store, …)). A statement runs to its ; or to the end of a line that no ./? chain continues, with parentheses and brackets kept together. Every source file the write leaves is read whole, tests included (.rs, .js, .mjs, .cjs, .ts, .py, .sh, .bash, .zsh, .swift, .go, .rb); a shell command is read as it is run.

#What a refusal says

block-credential-copies: BLOCKED: this copies a credential store, whose OAuth refresh tokens a process using the copy spends, voiding the ones the original holds and signing its accounts out: followed by one line per copy, <file>: <copy> of <store>: <statement> (or the shell command:), and the way out: link the store (ln -s, std::os::unix::fs::symlink) so every process refreshes the one store under the harness's own refresh coordination, or read what is needed from it in place, read-only. These pass: a link to a store, a read-only open of it, and a copy of any other file beside it. A write whose resulting file cannot be rebuilt is refused with its cause.

#Where it comes from

Source: rust/crates/tama-hook-tools/src/ports/block_credential_copies/. Declaration: hook-declarations/code-discipline/block-credential-copies.json; the gate runs once tama hooks declare --file enters it in the registry. The journey cargo test --manifest-path rust/Cargo.toml -p tama-cli --test credential_copies_refusal runs the built hook: a test file that vacuums OMP's store into its home, a copy through a name bound to Claude Code's credentials and a shell cp of Codex's are refused naming the copy and the store; a link, a read-only open and a copy of another file pass.