assess_risk_tier
Maps an AI system description to EU AI Act risk tiers (Unacceptable, High, Limited, Minimal) and provides MAI governance recommendations.
Instructions
Assess the risk tier of an AI system using rule-based mapping to EU AI Act categories (Unacceptable, High, Limited, Minimal). Returns tier and MAI governance recommendations. Classification is heuristic, not a legal determination.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| system_description | Yes | Description of the AI system or operation | |
| domain | Yes | Industry domain | |
| affects_individuals | Yes | Whether the system makes decisions affecting individuals | |
| autonomous_decisions | Yes | Whether the system makes autonomous decisions |
Implementation Reference
- src/mcp/tools/assess-risk-tier.ts:16-92 (handler)The main handler function 'registerAssessRiskTierTool' that registers the 'assess_risk_tier' tool with an MCP server. Takes system_description, domain, affects_individuals, and autonomous_decisions as inputs; applies rule-based classification to determine EU AI Act risk tier (HIGH/LIMITED/MINIMAL), checks for PII, and returns risk tier, MAI recommendation, and governance requirements.
export function registerAssessRiskTierTool(server: McpServer, engine: GovernanceEngine): void { server.tool( 'assess_risk_tier', 'Assess the risk tier of an AI system using rule-based mapping to EU AI Act categories (Unacceptable, High, Limited, Minimal). Returns tier and MAI governance recommendations. Classification is heuristic, not a legal determination.', { system_description: z.string().max(MAX_INPUT_LENGTH).describe('Description of the AI system or operation'), domain: z.string().describe('Industry domain'), affects_individuals: z.boolean().describe('Whether the system makes decisions affecting individuals'), autonomous_decisions: z.boolean().describe('Whether the system makes autonomous decisions'), }, { title: 'Assess Risk Tier', readOnlyHint: true, idempotentHint: true, destructiveHint: false, openWorldHint: false }, async (input) => { const desc = sanitize(input.system_description); const hasPii = detectPii(desc); // EU AI Act Annex III — domains classified HIGH risk regardless of caller flags. // "Administration of social benefits" and similar individual-outcome domains are // HIGH risk even when the caller omits affects_individuals: true. const HIGH_STAKES_DOMAINS = ['va-claims', 'va_claims', 'veterans', 'healthcare', 'legal', 'financial', 'justice', 'employment', 'education', 'social-benefits', 'immigration']; const domainStr = input.domain.toLowerCase(); const descStr = desc.toLowerCase(); const domainIsHighStakes = HIGH_STAKES_DOMAINS.some(d => domainStr.includes(d) || descStr.includes(d.replace('-', ' ')) ); // Treat autonomous decisions in high-stakes domains as affecting individuals — // the caller flag is advisory; domain context is authoritative. const effectiveAffectsIndividuals = input.affects_individuals || (input.autonomous_decisions && domainIsHighStakes); // Risk tier assessment logic (delegatable to CORE in future) let tier: string; let maiRecommendation: string; if (effectiveAffectsIndividuals && input.autonomous_decisions) { tier = 'HIGH'; maiRecommendation = 'All agent actions should be MANDATORY classification. Human-in-the-loop required.'; } else if (effectiveAffectsIndividuals) { tier = 'HIGH'; maiRecommendation = 'Decision points should be MANDATORY. Processing can be ADVISORY.'; } else if (input.autonomous_decisions) { tier = 'LIMITED'; maiRecommendation = 'Outputs should be ADVISORY. Internal processing can be INFORMATIONAL.'; } else { tier = 'MINIMAL'; maiRecommendation = 'Standard governance applies. INFORMATIONAL for processing, ADVISORY for outputs.'; } if (hasPii) { tier = 'HIGH'; maiRecommendation = 'PII detected. Elevate all operations to MANDATORY minimum. Apply SOVEREIGN data handling.'; } // Tool accountability tracking engine.telemetryService.emitToolCall('assess_risk_tier', `risk-${Date.now().toString(36)}`, 'INFORMATIONAL', true); return { content: [{ type: 'text' as const, text: JSON.stringify({ riskTier: tier, domain: input.domain, piiDetected: hasPii, affectsIndividuals: input.affects_individuals, effectiveAffectsIndividuals, domainElevated: domainIsHighStakes && !input.affects_individuals && input.autonomous_decisions, autonomousDecisions: input.autonomous_decisions, maiRecommendation, governanceRequirements: { auditRequired: true, gateRequired: tier === 'HIGH', scoringRequired: true, thresholdMonitoring: true, humanOversight: tier === 'HIGH' ? 'MANDATORY' : 'ADVISORY', }, }, null, 2) }], }; } ); } - Zod schema for input validation: system_description (string, max 50k chars), domain (string), affects_individuals (boolean), autonomous_decisions (boolean).
system_description: z.string().max(MAX_INPUT_LENGTH).describe('Description of the AI system or operation'), domain: z.string().describe('Industry domain'), affects_individuals: z.boolean().describe('Whether the system makes decisions affecting individuals'), autonomous_decisions: z.boolean().describe('Whether the system makes autonomous decisions'), }, - src/mcp/server.ts:95-95 (registration)Tool registration entry in the TOOL_REGISTRY array, mapping 'assess_risk_tier' to 'public' visibility tier and the registerAssessRiskTierTool function.
{ tier: 'public', register: registerAssessRiskTierTool, description: 'assess_risk_tier' }, - src/shared/utils.ts:15-21 (helper)Helper function 'sanitize' used by the handler to strip HTML/script tags from input text.
export function sanitize(input: string): string { return input .replace(/<script[\s\S]*?<\/script>/gi, '') .replace(/<[^>]*>/g, '') .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '') .trim(); } - src/shared/utils.ts:23-30 (helper)Helper function 'detectPii' used by the handler to check for PII patterns (SSNs, dates) in the input description.
export function detectPii(text: string): boolean { const patterns = [ /\b\d{3}-\d{2}-\d{4}\b/, /\b\d{2}\/\d{2}\/\d{4}\b/, /\b\d{4}-\d{2}-\d{2}\b/, ]; return patterns.some(p => p.test(text)); }