Skip to content

FEAT-002 — real session ids, startup validation, views and audit for tainted sessions (#171) - #194

Merged
jmmana merged 1 commit into
mainfrom
feat/171-sessions-views
Nov 30, 2026
Merged

jmmana merged 1 commit into
mainfrom
feat/171-sessions-views

Conversation

@jmmana

@jmmana jmmana commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Refs #171. Finishes the open parts of the issue.

  • Session identity: the MCP SDK builds a new session object for every request (checked), so the default key is the server-assigned mcp-session-id header; no header means an unknown session, which counts as tainted. State is bounded (10,000 sessions). single_session (stdio) and an explicit session_id callable still win.
  • Startup validation: sensitive_tables and untrusted_columns entries must exist in the database, so a typo cannot silently disable the protection.
  • Views: reflected at startup; a view over a sensitive table is sensitive, a view over an untrusted column is untrusted, an unparseable view is both (fail closed).
  • Audit: the taint check runs before the guard, so a refused query is recorded once, as a refusal.
  • Written with the Claude API (Sonnet 5.5) and local checks; ruff, mypy and pytest pass locally.

Leaves out #155, #156, versions and release.yml.

🤖 Generated with Claude Code

…s, audit (#171)

Fail closed without a session id, taint check before the guard so a refusal is audited once,
listed tables and columns must exist, views over sensitive or untrusted data propagate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 30, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@jmmana
jmmana merged commit 25e5091 into main Nov 30, 2026
24 checks passed
@jmmana
jmmana deleted the feat/171-sessions-views branch November 30, 2026 18:57
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.

2 participants