Repository navigation
fix(sanitize): stop redacting member paths and lowercase type annotations - #95
Conversation
…ions The alphabetic-password fix (a5f129d) spared a bare identifier only when it equalled its key, so ordinary source code was redacted again: `accessToken: string | null` and `state.accessToken = action.payload`. Treat a bare digitless dotted path as a code reference, and a bare lowercase built-in type name after `:` as an annotation. Quoted values and plain words such as `password=correcthorse` stay redacted. Part of tinyhumansai/openhuman#7713
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
…keys `password=correct.horse` is as likely a value as a member path, so the member-path exemption now applies only to token, key, credential and bearer keys, where code like `x.token = action.payload` is common. Part of tinyhumansai/openhuman#7713
Fold the near-duplicate cases into one table per behaviour, drop the auth-slice test whose lines are asserted on their own, and keep only the type names the issue covers. Part of tinyhumansai/openhuman#7713
Tiny Sweeper reviewTiny Sweeper completed its review; deterministic results follow. State: Ready for maintainer review Review snapshot
Completeness: Complete Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["looks_like_secret<br/>changed"]:::changed
n1["scrub_credentials<br/>changed"]:::changed
n2["...nces_and_type_annotations_are_not_secrets<br/>changed"]:::changed
n3["assert_unchanged"]:::impacted
n4["sanitize_api_error"]:::impacted
n5["scrub_secret_patterns"]:::impacted
n6["fixture"]:::impacted
n7["known_secret_prefixes_are_always_redacted"]:::impacted
n8["..._a_literal_is_code_but_a_full_stop_is_not"]:::impacted
n1 -->|calls| n0
n2 -->|calls| n3
n2 -->|tests| n3
n4 -->|calls| n5
n7 -->|calls| n1
n7 -->|tests| n1
n7 -->|calls| n6
n7 -->|tests| n6
n8 -->|calls| n1
n8 -->|tests| n1
n8 -->|calls| n3
n8 -->|tests| n3
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinyinference-core/src/sanitize.rs, crates/tinyinference-core/src/sanitize_tests.rs.
$0.0022 · 203,404 in / 32,311 out · 52,608 cached (26%) · ladder/vectors-oai3, deepseek-v4.1-flash · 238 embedded
critique: $0.0008 · 43,367 in / 12,747 out · 19,456 cached (45%) · deepseek-v4.1-flash
security: $0.0011 · 89,661 in / 17,076 out · 22,144 cached (25%) · deepseek-v4.1-flash
tests: $0.0000 · 35,077 in / 393 out · 5,120 cached (15%) · deepseek-v4.1-flash
description: $0.0001 · 32,273 in / 874 out · 5,888 cached (18%) · deepseek-v4.1-flash
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0025 · 253,603 in / 19,719 out · 42,240 cached (17%) · ladder/vectors-oai3, deepseek-v4.1-flash · 238 embedded
critique: $0.0001 · 86,837 in / 1,025 out · 9,344 cached (11%) · deepseek-v4.1-flash
security: $0.0018 · 87,630 in / 9,835 out · 9,856 cached (11%) · deepseek-v4.1-flash
tests: $0.0005 · 58,418 in / 7,149 out · 16,256 cached (28%) · deepseek-v4.1-flash
description: $0.0000 · 17,388 in / 376 out · 6,784 cached (39%) · deepseek-v4.1-flash
Moves vendor/tinyinference from 8607cefd to 5c413dcf (tinyinference main), which brings in tinyhumansai/tinyinference#95 (scrubber stops redacting member paths and lowercase type annotations), #102 (streamed usage extension fields kept on raw) and #90 (output-limit stops reported as `length`). No crate manifest changed between the pins, so Cargo.lock is unchanged. Part of tinyhumansai/openhuman#7713
Summary
scrub_credentialsis redacting ordinary source code again. Since a5f129d (#60), a bare identifier is spared only when it equals its key. SoaccessToken: string | null;came back asstri*[REDACTED], andstate.accessToken = action.payload;asacti*[REDACTED]. An agent reading its own TypeScript auth code saw a redacted view and could not recover, because the notice tells it not to retry.Two narrow exemptions:
action.payload,config.apiKey) counts as a code reference inlooks_like_secret, but only under token/key/credential/bearer keys. Under*password/*secretkeys a dotted word stays redacted.:(TS primitives, plus Pythonstr/int/float/bool; seeLOWERCASE_TYPE_NAMES) counts as an annotation, next to the existing uppercaseStringexemption.Related issue
Part of tinyhumansai/openhuman#7713. The gitlink bump tinyinference → tinyagents → openhuman follows after merge.
API or behavior changes
No API change. Fewer false-positive redactions:
password=correcthorse,password: correcthorse) and dotted values containing digits.password=correct.horse,secret: a.bandclient_secret = battery.staple.*_KEYname (const USER_KEY = 'anime-shop-user'). It cannot be told apart from a short real key, andapi_key="short"is pinned as redacted.Validation
No local builds or tests, by repo-owner policy for this contributor; GitHub CI is the gate.
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warnings: CIcargo build --all-targets --all-features: CIcargo test --all-features: CIRevert-check: the not-run expectations below follow from the pre-fix code path. Reverting the
sanitize.rshunks makesmember_paths_and_lowercase_type_annotations_are_not_secretsfail:stringandaction.payloadreach the!value.eq_ignore_ascii_case(key)arm. Dropping the password/secret guard makesvalues_that_only_resemble_code_references_stay_redactedfail oncorrect.horseanda.b.Tests
Two table-driven tests in
sanitize_tests.rs, next to the #6954 cases:member_paths_and_lowercase_type_annotations_are_not_secrets: TSstring, Pythonstr(also under a password key), and dotted paths under token, key and credential keys.values_that_only_resemble_code_references_stay_redacted: quoted"string",password: correcthorse,password=correct.horse,secret: a.b, andtoken=abc123.def456.The existing
alphabetic_password_assignment_is_redactedis unchanged.Documentation
Not needed: the rule is documented in comments at both exemption sites.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description