Skip to content

Seams for auditing: typed output observation and explicit table access - #183

Closed
UnknownJoe796 wants to merge 1 commit into
version-5.3from
split/e1
Closed

UnknownJoe796 wants to merge 1 commit into
version-5.3from
split/e1

Conversation

@UnknownJoe796

Copy link
Copy Markdown
Contributor

Stack: 1 of 16. Base: version-5.3. Merge in order.
Three changes to existing code that exist so an audit layer has somewhere to
attach. Nothing fires them yet; the audit modules come later in the stack.

  • TypedOutputInterceptor observes a typed value after the handler produces
    it and before it is serialized. Firing before serialization is the point:
    the response body does not exist yet, so an observer that throws prevents
    the disclosure rather than reporting it after the fact.
  • ModelInfo splits audited from unaudited table access. baseTable() keeps
    skipping permissions but now routes through the existing log decorator,
    and the undecorated path becomes dangerouslyDirectTable() behind an
    opt-in @UnauditedDatabaseAccess. The goal is not to forbid the bypass but
    to make every instance greppable.
  • ModelRestEndpoints declares the fields it discloses.

log already existed with an identity default, so with no audit layer
installed this is behaviour-neutral. dangerouslyDirectTable() has a default
implementation, so it is not a breaking change for existing ModelInfos.


🤖 Generated with Claude Code

https://claude.ai/code/session_01Jybc9zdLT2sEfJUpErf2cd

Three changes to existing code that exist so an audit layer has somewhere to
attach. Nothing fires them yet; the audit modules come later in the stack.

- `TypedOutputInterceptor` observes a typed value after the handler produces
  it and before it is serialized. Firing before serialization is the point:
  the response body does not exist yet, so an observer that throws prevents
  the disclosure rather than reporting it after the fact.
- `ModelInfo` splits audited from unaudited table access. `baseTable()` keeps
  skipping permissions but now routes through the existing `log` decorator,
  and the undecorated path becomes `dangerouslyDirectTable()` behind an
  opt-in `@UnauditedDatabaseAccess`. The goal is not to forbid the bypass but
  to make every instance greppable.
- `ModelRestEndpoints` declares the fields it discloses.

`log` already existed with an identity default, so with no audit layer
installed this is behaviour-neutral. `dangerouslyDirectTable()` has a default
implementation, so it is not a breaking change for existing `ModelInfo`s.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jybc9zdLT2sEfJUpErf2cd
@UnknownJoe796

Copy link
Copy Markdown
Contributor Author

Passes my review.

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