AI CONTRACT SPEC TEMPLATE (copy/paste into your PRD) 1) Feature name + user job - Feature: ______________________________ - User job (one sentence): _______________ - Non-goal (what this is NOT): ___________ 2) Contract: the user-facing promise Write this as UI copy you’d be willing to show. - The assistant WILL: __________________________ - The assistant WILL NOT: ______________________ - It may be wrong when: ________________________ - If unsure, it will: (ask / cite / escalate / stop) _________ 3) Inputs + grounding rules - Allowed data sources (explicit systems): ______________ - Disallowed sources: _________________________________ - Retrieval required? (yes/no; for which intents): _______ - Citation rule: (links, doc titles, inline quotes): ______ 4) Actions + tool boundaries For every tool/action the model can trigger: - Tool name: __________________ - What it can change: __________ - Scope control: (role-based, allowlist, environment) _____ - Confirmation UX: (preview + confirm? two-person approval?) ______ - Hard blocks (never execute): __________________________ 5) Data retention + memory - What is stored: (prompts, outputs, tool calls, retrieved docs) ______ - Retention period: ____________ (or “configurable by admin”) - Memory behavior: - Session-only mode: (yes/no) ______ - Persistent memory: (yes/no) ______ - User controls: (toggle, ‘forget this’, export) __________ 6) Safety + refusal behavior - Refusal categories relevant to this feature: ______________________ - Required safe alternative: (template, FAQ link, handoff) ___________ - Escalation path: (human review queue / ticket / chat handoff) ______ 7) Observability (must-have logs) - Log events: - retrieval_performed (doc IDs + ranking) - tool_invoked (tool + params + user) - confirmation_shown / confirmation_approved - refusal_triggered (category) - escalation_triggered (destination) - Redaction rules (what never lands in logs): _______________________ 8) Release tests (contract tests, not vibes) Define invariants; avoid exact-string “goldens.” - Test case 1: ____________________ - Invariants: (must cite / must ask / must not call tool / must refuse) - Test case 2: ____________________ - Regression trigger: run on prompt change / model change / retrieval change / tool schema change. 9) Fallback plan - If model/API is down: ______________________________ - If retrieval fails: _________________________________ - If tool execution fails: _____________________________ 10) Ownership - Product owner: ___________ - Eng owner: ______________ - Security/Privacy reviewer: _________ - Support runbook link: _____________ Ship rule: if you can’t fill this out without hand-waving, the feature isn’t ready.