Skip to content

Policy: reading a Kubernetes or Vault secret waits for a person (TK-A052, TK-A053) - #582

Merged
LoopGlitch26 merged 3 commits into
mainfrom
agent/issue-404
Nov 6, 2026
Merged

LoopGlitch26 merged 3 commits into
mainfrom
agent/issue-404

Conversation

@LoopGlitch26

@LoopGlitch26 LoopGlitch26 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #404. Supersedes #549 by @shrinivas-sn, who wrote the first version of TK-A052 and TK-A053 and their cases (credited as co-author). It carries the review's changes, with main merged in after #543 and #608.

What changed from #549:

  • False alarms fixed, with tests that they're allowed.
    • kubectl get -o yaml clusterrole secret-reader and -n secrets-store: a type word now ends only at a space, / or ,.
    • -n/--namespace always take their value, so kubectl get -n secrets deploy -o yaml isn't held.
  • Spellings that print values are held:
    • -o custom-columns=PW:.data.password and --template={{.data.password}};
    • oc extract secret/db --to=-;
    • a type later in a list (cm,secrets);
    • Secret in another case;
    • vault print token, vault write auth/token/create and vault unwrap;
    • OpenBao's bao, which uses the same commands.
  • Docs:
    • The A035 row names op (1Password's CLI), not 1password.
    • A limits row for what stays unheld.
    • Both rules are listed in docs/policy-v2.md.
  • Speed: the 64 KiB speed test caught a quadratic TYPE/NAME read, now fixed; the worst case takes 11 ms.

Pack: coding becomes 2026.10-v2-63 (main has -62); dev, server and strict change hash with it.

Results:

  • E17: 828 of 828 held, 1 false alarm in 881.
  • E21:
    • feat: add E21 blind evaluation pool for amandeavor (fixes #368) #401's blind pool goes from 32 to 36 of 45 (strict: 35 to 39), the issue's four calls;
    • held-out goes from 252 to 254 (60.5%), strict from 284 to 285;
    • no new false positive;
    • 500 commands and 2,405 rewrites contained;
    • E21's recorded latency rows are kept: run without --rebaseline or --record, the gates passed (default RE2 p99_ref 5.25, recorded 5.23).

Tests (a sealed container, no network): tests/test_signer_policy.py, test_policy2.py, test_eval_docs.py, test_e21_policy.py and test_e21_robustness.py pass (348, 30,867 subtests), E17 and E21 re-run equal the committed results, and make lint is clean. Against main, over 11,615 calls on every pack and both engines, nothing is loosened: 164 calls are newly held, each by TK-A052 or TK-A053, and no benign case changes.

LoopGlitch26 and others added 2 commits November 4, 2026 02:41
The second blind E21 pool read secrets through kubectl and Vault, and every
pack let them through. Two coding-pack rules, next to TK-A035, hold them in
the coding, dev, server and strict packs:

- TK-A052: kubectl's or oc's get of a secret with an output that prints it
  (any -o or --output but name and wide, custom-columns and kyaml too, or a
  --template), oc extract of a secret, view-secret (kubectl-view-secret too)
  and create token. The type is read in any case, with its API group, as
  TYPE/NAME, in a list (cm,secrets) or as a later TYPE/NAME, with the output
  before or after it. -n and --namespace take their value, so a namespace
  named secrets isn't a type, and a type ends at a space, / or , (a role
  named secret-reader isn't one).
- TK-A053: vault's (or OpenBao's bao) kv get, read, unwrap, print token,
  token create and a write to auth/token/create.

Listing secret names, describing one, kv list and metadata, token lookup and
status stay allowed. Both rules are anchored and bounded: 11 ms at worst on
64 KiB on the fallback engine. The TK-A035 limits row no longer lists vault
and kubectl as unheld (and names 1Password's op, not "1password"); a new row
names what TK-A052 and TK-A053 don't read.

E17 gains 22 harmful and 15 benign cases (800 of 800 held, 1 false alarm in
858). E21: the second blind pool (#401) is held 34 of 45 by default (was 30)
and 37 strict (was 33), the four calls of the issue; the held-out pool 254 of
420 (60.5%, was 252) and 285 strict (was 284); no new false positive in any
set. E21's committed machine and latency are kept.

The coding pack's version is 2026.10-v2-57, which other open pull requests
also take; it may need renumbering at merge.

Finishes #549 by shrinivas-sn: their rules' cases and look-alikes, with the
review's false-alarm fixes, other spellings, docs and evals.

Fixes #404

Co-authored-by: shrinivas-sn <shrinusn2001@gmail.com>
Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…ype ninth in a list, or kubectl through an MCP tool

Co-authored-by: shrinivas-sn <shrinusn2001@gmail.com>
Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…-run, E21's recorded latency rows kept

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26
LoopGlitch26 merged commit 21f395e into main Nov 6, 2026
57 of 60 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/issue-404 branch November 6, 2026 00:01
LoopGlitch26 added a commit that referenced this pull request Nov 6, 2026
Brings in #582 (TK-A052, TK-A053; coding pack 2026.10-v2-63), #543 (TK-C010),
#612, #595, #621 and the commits before them.

- coding.yaml: version 2026.11-v2-64, the next free one. server-17,
  strict-10, server-core-1 and dev-1 are numbers main hasn't used.
- docs/policy-v2.md: merged word by word, main's TK-A052 and TK-C010 text
  with this branch's.
- docs/evaluation.md: main's "refreshed on macOS" note with this branch's
  dev-row note.
- eval results: main's files, then E17, E21 rewrites (no --rebaseline) and
  E21 policy robustness re-run. The recorded latency rows are main's, and
  this branch's dev row (5.44 / 6.28) as before.
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.

Policy: reading Kubernetes and Vault secret values waits for a person

1 participant