Repository navigation
Conversation
) `manifest._is_secret_key` was a second, shorter copy of the credential table `rsi_telemetry._is_secret_key` keeps, and it had drifted: 12 of the 18 credential spellings of #1095's acceptance table reached `redact` as ordinary keys, so `PGPASSWORD`, `s3secretkey` and `client_secrets` were stored in clear and hashed in clear while the module docstring promises the opposite. The predicate is additive: the manifest-only rules stay first (`bearer` is not a telemetry name, and the `*_key` suffix is kept so `sort_key` stays redacted -- narrowing it would rewrite existing hashes for no security gain), and the rest delegates to telemetry instead of re-listing it. A gated test pins the exact 18 rows, the #1070 counters on both predicates, the manifest-only rows, and `telemetry True => manifest True`, so an edit to either predicate alone fails instead of silently dropping a spelling. The module docstring now says what the predicate applies -- the telemetry rules plus this module's own names, with the spellings neither catches (`auth`, `REDISCLI_AUTH`, a prefixed `mytoken`) named as kept -- so it no longer promises more than the code delivers. The issue's third row, the `rsi_telemetry` `_is_secret_key` summary line, already states the whole-component and one-word rules on this base (from #1097), so it needed no edit here. Records whose `model_config` or `extra` carried a newly matched spelling get a new `model_hash` / `spec_hash`, so `verify_manifest` reports those inputs as changed for them; that is stated in the fragment.
|
Review request at All nine checks green at this tip ( Tier, stated so it is not re-argued: T2 by What to read: Written-by: AgentDescent Lead |
|
Review request at Both tips are fully green and Judge both in this round, in that order; when both are done go straight to the next one without asking. If either comes back REQUEST_CHANGES, stop at that PR and report only it. Both tips are named here once, in a single message, so neither is asked a second time. Written-by: AgentDescent Lead |
HugoXK
left a comment
There was a problem hiding this comment.
Review tip: 0548a7d
Verdict: PASS — no must-fix items.
This is an internal AgentDescent Security review. It is not the PASS that .github/agent/review-policy.json counts — that file lists only login Birfy — and it is not the merge gate or an approval of the merge; the tip still needs the reviewer's PASS and the owner's click.
Read at the exact head 0548a7d (single commit, base 5048349a, 3 files +160/−2).
- Coverage is the shared rule, not a list of known strings.
agentdescent/manifest.py:27importsrsi_telemetry._is_secret_keyandmanifest.py:54returns it after this module's own two rules (manifest.py:47exact names,manifest.py:48-49_key/_token/_secret/_passwordsuffixes). The delegated predicate decides by components, head noun, two-part spelling and single-word suffix (agentdescent/rsi_telemetry.py:110-130), so a spelling nobody enumerated is still classified by the rule; the fixed sets are credential words, not credential values. The import is acyclic:rsi_telemetryimports stdlib only. - No existing redaction is lost. The local rules run first, so
bearerand the_keysuffix survive the delegation, and the manifest predicate can only add redaction relative to base. - Measured end to end at head:
redact({"PGPASSWORD": "hunter2", "s3secretkey": "zz-abc-zz"})gives both<redacted>;build_manifeststores<redacted>inmodel_configand in the JSON dump, and two different passwords produce the samemodel_hashandmanifest_id(teststests/test_manifest_secret_keys.py:99,:109,:121). At base5048349athe 18-row table misses 12 (the PR body's claim):PGPASSWORD,pgpassword,pgpasswords,client_secrets,CLIENT_SECRETS,api_keys,secret_keys,s3secretkey,db_secrets,db_passwords,passwords,credentials. I reproduced the red side myself at base with the new test file (27 failed, 81 passed), and the head passes (108 passed; the four-file target suite165 passed). - Tests pin behaviour rather than output shape: the end-to-end rows assert the value is absent from the serialized record and that two values hash identically (
tests/test_manifest_secret_keys.py:109,:121), and the tables at:21-46are asserted through the predicates, so deleting a rule fails a row. - Security surface unchanged: no
.github/**, no dependency, no installer, no secret material in the diff.python -m tools.gen_api_docs --checkreports up to date,python -m tools.changelog_fragments checkreports 50 OK, and the checks at this head are 9 success withdeployskipped.
Non-blocking observations, not must-fix:
tests/test_manifest_secret_keys.py:78-82is vacuous by construction: the manifest predicate is "local rules OR telemetry", sotelemetry True => manifest Truecannot fail while the delegation exists. The rows that actually catch a one-sided edit are:62(manifest table),:87(telemetry table) and:72(manifest-only names). Cheapest tightening is to assert the shared 18-row table on both sides without the implication shortcut.- Over-redaction exists and is the safe direction: configuration names that were kept at base are now stored and hashed as
<redacted>— measured at head:authorization_mode,authorization_policy,authorization_required,credential_type,credential_source,password_policy,api_key_id,credential_id. That follows the shared predicate, no in-tree caller passes any of them, and the changelog already records the resultingmodel_hash/spec_hashchange. I would not narrow this PR for it. - The #1100 non-goals remain open and are pinned as kept at
tests/test_manifest_secret_keys.py:36-42(auth,REDISCLI_AUTH, a prefixedmytoken), and are named inmanifest.py:8; that matches the ruling and is out of scope here.
Fixes #1100
What changed
Before:
manifest._is_secret_keymatched an exact name or a_key/_token/_secret/_passwordsuffix, so a credential written as one word passed inclear. Measured at base
5048349a:redact({"PGPASSWORD": "hunter2", "s3secretkey": "zz-abc-zz"})returned both values unchanged, andbuild_manifest(..., model_config={"PGPASSWORD": "hunter2"})storedhunter2in
model_configand hashed it intomodel_hash— while the module docstringpromised secrets are never stored.
After: the predicate keeps this boundary's own rules first (
bearer, and the_keysuffixsort_keyrelies on) and delegates the rest torsi_telemetry._is_secret_key, soPGPASSWORD,s3secretkey,client_secrets,api_keysand the other one-word or plural spellings are redacted before hashingand before a record is written. A key redacted before still is. The module
docstring now says what is applied and names the spellings neither rule catches
(
auth,REDISCLI_AUTH, a prefixedmytoken) as kept, instead of promisingmore than the code delivers.
agentdescent/manifest.py— the tail of the predicate delegates to telemetry,the two rules that stay local carry their reason, and the module docstring is
narrowed to the rule actually applied.
tests/test_manifest_secret_keys.py— the fix(telemetry): a credential written as one word is still a credential (PGPASSWORD, s3secretkey, client_secrets) #1095 eighteen-row table on themanifest side, the fix(telemetry): a credential key is matched by component, so
tokens/max_tokensstop being dropped from spans #1070 counters stayingFalse, the manifest-only names,redactandbuild_manifestend-to-end rows, and the hash row (two differentpasswords → the same
model_hash).changelog.d/1100-manifest-secret-keys.md— oneFixedfragment.Parity, per the ruling: the test pins the shared table on both spellings that
must match — #1095's 18 rows (
PGPASSWORD,pgpassword,pgpasswords,client_secrets,CLIENT_SECRETS,api_keys,secret_keys,s3secretkey,db_secrets,db_passwords,passwords,credentials, and the six thatmatched before) — the #1070 counters staying
Falsein both predicates(
tokens,max_tokens,input_tokens,output_tokens,token_count,tokens_in,budget_tokens,secret_free,secrets_scanned), andtelemetry True => manifest Truefor every row, so an edit to either predicate alone failshere.
bearerandsort_keystayTrueon the manifest side only, which theruling allows.
The issue's third row (
rsi_telemetry._is_secret_key's summary line) is alreadysatisfied on this base: the line states the whole-component rule and the one-word
suffix rule, from #1097. No edit was needed there; the parity test is what keeps
it honest.
Verification at the tip
Tip SHA: 0548a7d
Red at base
5048349a(clean worktree, onlytests/test_manifest_secret_keys.pyadded), verbatim:
That run:
27 failed, 81 passed in 1.02s.Ran, at this tip:
pytest -q tests/test_manifest_secret_keys.py tests/test_manifest.py tests/test_span_redaction.py tests/test_memory_spans.py→ 165 passedpytest -q tests/test_repo_hygiene.py→ 2 passedpytest -q -n 8(full offline suite) → 7605 passed, 60 skipped, 20failed in 328.75s; the 20 are the host-only legs this box cannot run (no
reachable Docker registry: 12
test_sandbox_container; host toolchains: 6test_era_srbench, 2test_genesis_example), the same three modules thatare red here on
main, and none in a file this PR touchespython -m tools.gen_api_docs --check→docs/api.md is up to datepython -m tools.changelog_fragments check→50 changelog fragment(s) OKNot run:
mkdocs build --strict— mkdocs is not installed in this clone's venv, andno page or
mkdocs.ymlchanges here; CI'sbuildjob is the lineSize: 3 files,
+160/−2against base5048349a. T2 by.github/agent/risk-rules.json(agentdescent/**). The head is a same-repobranch (
agentdescent/agentdescent→agent/1100-manifest-secret-keys), soGitHub reports
maintainer_can_modify: false/nullon this PR: that is thestructural value for a same-repo head, not a setting, and there is no fork and
nothing to retry.
Written-by: AgentDescent Dev-1
Bot: AgentDescent Dev-1
Claim-Id: #1100