Skip to content

feat(api): expose security modes and per-provider redact - #1

Merged
fylorn merged 1 commit into
mainfrom
dev
Sep 13, 2026
Merged

fylorn merged 1 commit into
mainfrom
dev

Conversation

@fylorn

@fylorn fylorn commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

/overview carried neither security nor a provider's redact, so the desktop UI could show neither — the only way to see whether outbound redaction was on was to open config.yaml.

That quietly broke §5.0's premise: all three defences ship in observe mode so the user can see evidence about their own traffic and then decide to enforce. A switch nobody can reach makes that default permanent.

Adds SecurityView, ProviderView.redact, and Mode::slug() (separate from label() — writing the Chinese label into YAML would fail the next load outright).

🤖 Generated with Claude Code

… set

`/overview` didn't carry `security` at all, and `ProviderView` didn't
carry `redact`. So the desktop UI could show neither — the only way to
find out whether outbound redaction was on was to open config.yaml.

That quietly broke §5.0's premise. All three defences ship parked in
observe mode on purpose: the design is that a user sees evidence
collected about their own traffic and then decides whether to switch to
enforce. A switch nobody can reach makes the observe default a
permanent state rather than a starting one.

- `SecurityView` carries all three modes plus the counts of added and
  disabled scan rules. The verbs differ per line — redact replaces,
  inspect_tools cuts the stream, scan_configs only warns — so the UI has
  to say what enforce means here rather than labelling all three
  "enforce".
- `ProviderView.redact` gives the resolved set, like `trust` does, with
  an `explicit` flag beside it. Unset means empty for vendor endpoints
  and the four defaults elsewhere, and the UI has to distinguish "not
  written" from "written empty".

`Mode::slug()` is new and separate from `label()`. `label()` is the
Chinese shown to a human; `slug()` is what gets written back to YAML.
Writing the label into config.yaml would fail the next load outright,
because this layer deliberately refuses to silently fall back (§5.0:
"thought I had enforce on, was only observing" is the worst state) —
so it would surface as a startup failure the user can't interpret.

The round-trip test is the point of that split: it deserializes every
slug back and asserts it lands on the same mode. It isn't testing a
getter, it's pinning the contract between the UI and the loader.

1060 tests, 42 smoke checks, clippy clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 6ac917c into main Sep 13, 2026
3 checks passed
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