Tokens get a level (migration 0034). Summary stays the default; Full detail is the person's explicit choice on Connect your AI, with a confirmation, and is written into CLAUDE.md as the one exception to summary-only cloud AI. Full tokens get the full tools plus list_transactions, update_transactions and mark_transfer_pair; IBANs and long account numbers are shortened in everything they return (ids stay intact). Isolation tested with two users and an accepted partner share: RLS alone lets the partner read the owner's shared rows, but every tool also filters on the token's user, so nothing leaked and no change landed (own ids, rule id, names). Also fixes the full spending_summary crashing on rows without a category. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 lines
385 B
SQL
5 lines
385 B
SQL
-- What an MCP token may see: the summary (like every cloud AI), or full detail, which the person turns on for that
|
|
-- token themselves on Connect your AI. Tokens made before this stay summary.
|
|
alter table public.mcp_tokens add column if not exists level text not null default 'summary' check (level in ('summary', 'full'));
|
|
grant select (level) on public.mcp_tokens to authenticated;
|