Templates/Customer Support SaaS/AI customer-support agent
AI customer-support agent
Drafter producing conversational responses with mandatory AI Act Art. 50 disclosure in the system prompt. Reviewer-gate on sensitive-topic flags + deterministic fallback to handoff.
What this template is
Pattern: conversational response drafter with Art. 50 disclosure baked into the system prompt (the spec hash binds the disclosure language to every L12 entry — if you change it, the chain shows the change). Reviewer-gate on schema-violation handles sensitive-topic outputs (legal advice requests, refund disputes); deterministic fallback hands the conversation to a human agent rather than emit a wrong answer.
The template
TypeScript · BSL-1.1 · License
import { RuntimeAISpec } from '@promethean/runtime-ai';
export const aiSupportAgentSpec: RuntimeAISpec = {
specId: 'ai-support-agent-v1',
displayName: 'AI customer-support agent',
description:
'Conversational drafter with AI Act Art. 50 disclosure + reviewer-gate.',
category: 'drafter',
schemaVersion: 'promethean-runtime-ai-spec-1.0',
canonicalForm: 'v1',
inputSchema: {
fields: [
{ name: 'conversationId', type: 'string', required: true,
redaction: 'hash-only' },
{ name: 'turnIndex', type: 'number', required: true,
min: 0, max: 100 },
{ name: 'customerMessage', type: 'string', required: true,
maxLength: 4000, redaction: 'hash-only' },
{ name: 'priorTurnsSummary', type: 'string', required: false,
maxLength: 1000, redaction: 'hash-only' },
{ name: 'productAreaTag', type: 'enum', required: true,
enumValues: [
'billing', 'shipping', 'returns', 'product-info', 'account', 'other',
] },
],
},
outputSchema: {
fields: [
{ name: 'replyText', type: 'string', required: true,
maxLength: 1200 },
{ name: 'topicFlags', type: 'string-list', required: false,
maxItems: 5, maxLength: 32 },
{ name: 'handoffSuggested', type: 'boolean', required: true },
{ name: 'confidence', type: 'number', required: true,
min: 0, max: 1 },
],
},
promptTemplate: {
// AI Act Art. 50 disclosure baked into the system prompt.
// The spec hash commits this disclosure language to every entry.
system:
'You are an AI customer-support assistant. ' +
'On turn 0, you MUST disclose you are an AI: ' +
'"Hi! I\'m an AI assistant. A human teammate is available if you need one — just ask." ' +
'Set handoffSuggested=true if the message involves: ' +
'legal-advice request, refund dispute, account-closure, ' +
'safety / harm topics, or anything outside the supported product areas.',
user:
'Conversation {{conversationId}} turn {{turnIndex}} ({{productAreaTag}}). ' +
'Customer: {{customerMessage}}. ' +
'Prior turns summary: {{priorTurnsSummary}}.',
},
modelIdentity: {
provider: 'anthropic',
model: 'claude-sonnet-4-5',
version: '20250929',
},
reviewerGate: 'on-schema-violation',
maxLatencyMs: 3000,
fallbackBehavior: 'deterministic-default',
deterministicDefault: {
replyText:
'Thanks for reaching out — let me connect you with a teammate who can help.',
handoffSuggested: true,
confidence: 0,
},
};
Regulations addressed
This template's configuration choices map to specific regulatory obligations. The substrate doesn't certify compliance — but the spec hash + reviewer-verdict + modelIdentity per L12 entry give you the evidence layer for these citations:
- ·EU AI Act Art. 50 — transparency to users
- ·GDPR Art. 22 — refund / eligibility decisions
- ·Consumer Protection Cooperation Regulation 2017/2394
Installation + usage
- Create a free Dev-tier workspace — API key + Ed25519 signing key issued instantly.
- Install the SDK:
npm install https://promethean.software/runtime-ai/latest.tgz. - Paste the template above into your codebase. Adjust
modelIdentity+ prompt for your context. - Call
runConstrainedAI(spec, input, { client, receiptLogPath, productId, signingKey })from your service code. For local testing passcreateMockRuntimeAIClient(spec); for production, an Anthropic / OpenAI / Azure adapter. - Verify the chain with the Apache-2.0 verifier.