ai-surface-discipline
Apply input minimisation, output discipline, and a human-in-the-loop gate to every surface that sends data to an LLM. Triggers when building or editing any send-to-LLM path: an Edge Function calling a model, a draft-commentary or summary generator, an auto-resolver, a cash-allocation suggestion, a classification call, or any new AI-assist feature, especially in a RICS or UK GDPR regulated context.
randommonicle · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add randommonicle/claude-skills --skill ai-surface-discipline技能说明
name: ai-surface-discipline description: Apply input minimisation, output discipline, and a human-in-the-loop gate to every surface that sends data to an LLM. Triggers when building or editing any send-to-LLM path: an Edge Function calling a model, a draft-commentary or summary generator, an auto-resolver, a cash-allocation suggestion, a classification call, or any new AI-assist feature, especially in a RICS or UK GDPR regulated context.
AI-surface discipline
Every surface that sends data to an LLM inherits the same discipline before it ships. Three pillars (input minimisation, output discipline, human-in-the-loop gate) plus a credential and retention posture. This is a regulatory requirement, not a style preference: the surfaces touch leaseholder personal data and service-charge figures, which sit under UK GDPR, RICS client-confidentiality duties, and LTA 1985 accuracy obligations.
When this applies
This skill fires when building or editing any path that sends data to a model:
- Edge Functions that call an LLM provider
- Draft-commentary, summary, or narrative generators (variance, LPE, FME, year-end)
- Auto-resolvers and suggestion engines, including the reconciliation cash-allocation surface
- Classification, extraction, or matching calls
- Any new AI-assist feature, or any change to an existing one that alters what is sent or how output is used
It does not fire on read-only analytics or queries that never leave the database, or on features that process data entirely in-house with no model call.
Pillar 1: input minimisation
Defence starts at the boundary. The model receives the least data that does the job.
- Hardcoded never-send allowlist. Only named, reviewed fields cross the boundary. The allowlist lives in code, not config, so a data change cannot widen it silently. Default deny: a field not on the allowlist does not leave.
- Redact then restore. Where free text must be sent, redact personal identifiers before the call and restore the tokens in the response, so the user still gets readable output without the PII ever leaving the boundary.
- No PII passthrough. Leaseholder names, contact details, and account identifiers are not sent unless the allowlist names them and the lawful basis is recorded.
- Minimise by Article 5(1)(c). Data minimisation is a UK GDPR principle, not a nicety. If a field is not needed for the task, it is not sent.
- Guard against prompt injection. Free-text fields (dispute notes, maintenance descriptions, anything a leaseholder or third party can write) are data, not instructions. Do not concatenate user-supplied text into an instruction-bearing position, and sanitise it before it reaches the prompt, so a crafted input cannot redirect the model or pull allowlisted data into the response.
Pillar 2: output discipline
The model drafts. It does not decide or instruct.
- Descriptive, not prescriptive. Output describes figures and variances. It does not tell the leaseholder or client what to do, and it makes no statutory determination. This keeps the surface clear of FSMA-regulated advice.
- Every figure traceable. Any number in the output maps to a source row. The model does not introduce figures of its own.
- Labelled as AI-drafted. Generated content is marked as a draft pending human review wherever it is shown.
Pillar 3: human-in-the-loop gate
- PM-only by default. AI surfaces are visible to property managers, not to leaseholders or clients, unless a specific surface has been reviewed and re-scoped.
- Draft pending sign-off. AI output is never the final artefact. A human reviews and signs off before it counts.
- The send is a human action. Releasing AI-influenced content to a leaseholder or client is a separate, human-authorised step with its own gate. The model never triggers an outbound send.
Credential and retention posture
- Per-firm credentials. Each firm uses its own provider key. There is no platform-shared key for tenant data. See the per-firm credential pattern in project memory.
- Zero data retention for PII. Confirm the provider's current retention posture from its primary trust or privacy page before sending personal data, because the terms change. Do not rely on a figure quoted second-hand or from memory.
- Anthropic API: inputs and outputs are not used to train models, and a zero-data-retention addendum is available for enterprise. Confirm the current default retention window at the provider's trust page before a live deployment.
- OpenAI: zero data retention is opt-in via sales, not automatic, and an abuse-monitoring carve-out may still apply even with ZDR active. Do not assume it is on; confirm the scope in the agreement.
- Audit the outbound payload. Log what was sent (field names and a timestamp, not raw PII) and a response reference, retained for the applicable statutory period. UK GDPR accountability (Article 5(2)) and any later DSAR require you to reconstruct what data left the boundary, when, and for whom.
- No outbound network beyond the named endpoint. The surface talks to its declared provider and nothing else.
Regulatory anchors
UK GDPR (lawful basis, data minimisation, processor terms), RICS (client confidentiality), LTA 1985 (service-charge information accuracy), FSMA (output stays descriptive, never advice). These are the reasons the pillars exist. Cite the relevant one when a design decision turns on it.
What good looks like (pre-ship checklist)
- Allowlist is in code, default-deny, and reviewed.
- No PII leaves without a named lawful basis.
- Free-text inputs are sanitised against prompt injection.
- Output is descriptive and every figure is traceable to a source row.
- Surface is PM-only and gated behind human sign-off.
- Provider retention posture confirmed from the primary source.
- Per-firm credential used, no shared key.
- Outbound payload is logged (field names and timestamp, not raw PII).
- Rate or quo