Repository navigation
Let the owner delegate marking PII columns to the agent - #12
Merged
Merged
Conversation
A database's agentMarksPii setting (PUT /databases/:id/pii/agent, a switch on the PII columns tab) offers the MCP tool a markPii action. It only adds: every column must exist, a marked column stays marked, and only the owner can unmark one. The setting is checked on every call. The PII editor now saves its changes onto the server's latest set, so a save doesn't drop columns the agent marked while it was open. PII columns are inserted in batches: the documented maximum of 10000 hit SQLite's bound-variable limit in one INSERT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A per-database switch, Let the agent mark PII columns, on the PII columns tab. When it is on, the MCP
sqltool offers amarkPii {table, schema?, columns}action. An agent can add PII marks but never remove one: only the owner can uncheck a column.How
databases.agent_marks_pii(off by default, added by auto-migration), exposed asagentMarksPiion Database and set withPUT /databases/:id/pii/agent.crud.AgentMarkPIIonly inserts (ON CONFLICT DO NOTHING). Every column must exist in the live schema, matched case-insensitively and stored under its real name. A table name that exists in two schemas needsschema. The set is capped at the existing 10,000 limit. The flag is read from the database on every call, so turning it off stops an agent at once.helptext and the server instructions offermarkPii, and the instructions tell the agent to mark the personal data it finds. The tool'sReadOnlyHintbecomes false, because it changes the PII set (it never writes to the database itself). The answer is TOON:table,marked, thencolumns[N]{name,pii}, wherepiiismarkedoralready.docs/API.md, README, and an AGENTS.md rule: never give MCP a way to unmark a column.Tests
markPiiis offered only when allowed, the TOON output, payload errors.make lintis clean andmake cover BASE=mainpasses (every added line covered).🤖 Generated with Claude Code