Override Mechanisms
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Override Mechanisms allow humans to correct or reverse AI decisions, providing a critical safety net for automated systems. Proper override implementation includes tracking, justification, learning, and prevention of abuse.
Core Principle: "AI should be overridable, but overrides should be logged, justified, and learned from."
Why This Matters
Core Concepts & Rules
1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
Inputs / Outputs / Contracts
- Inputs:
- <e.g., env vars, request payload, file paths, schema>
- Entry Conditions:
- <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>
- Outputs:
- <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>
- Artifacts Required (Deliverables):
- <e.g., Code Diff, Unit Tests, Migration Script, API Docs>
- Acceptance Evidence:
- <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>
- Success Criteria:
- <e.g., p95 < 300ms, coverage ≥ 80%>
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Quick Start
Assumptions
- Users have appropriate permissions for their role
- Override reasons are provided in good faith
- Override correctness can be verified
- Model can be improved from override data
Compatibility
- Works with any AI/ML system
- Language-agnostic override patterns
- Can integrate with existing permission systems
Test Scenario Matrix
| Scenario |
Override Type |
Expected Behavior |
Notes |
| Low-impact decision |
Manual |
Immediate override |
No approval needed |
| High-impact decision |
Manual |
Requires approval |
Manager must approve |
| VIP customer |
Business rule |
Auto-approve |
Rule-based override |
| Emergency |
Emergency |
Kill switch |
Immediate, alerts team |
| Suspicious pattern |
Abuse detection |
Alert manager |
Prevent bulk overrides |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done
Anti-patterns / Pitfalls
- ⛔ Don't: Log PII, catch-all exception, N+1 queries
- ⚠️ Watch out for: Common symptoms and quick fixes
- 💡 Instead: Use proper error handling, pagination, and logging
Reference Links
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: override-mechanisms3description: Override Mechanisms allow humans to correct or reverse AI decisions, Use when this capability is needed.4---56# Override Mechanisms78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Override Mechanisms allow humans to correct or reverse AI decisions, providing a critical safety net for automated systems. Proper override implementation includes tracking, justification, learning, and prevention of abuse.1819**Core Principle**: "AI should be overridable, but overrides should be logged, justified, and learned from."2021---2223## Why This Matters24- **<Benefit>**: <short explanation>25- **<Benefit>**: <short explanation>26- **<Benefit>**: <short explanation>2728## Core Concepts & Rules2930### 1. Core Principles31- Follow established patterns and conventions32- Maintain consistency across codebase33- Document decisions and trade-offs3435### 2. Implementation Guidelines36- Start with the simplest viable solution37- Iterate based on feedback and requirements38- Test thoroughly before deployment394041## Inputs / Outputs / Contracts42* **Inputs**:43 - <e.g., env vars, request payload, file paths, schema>44* **Entry Conditions**:45 - <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>46* **Outputs**:47 - <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>48* **Artifacts Required (Deliverables)**:49 - <e.g., Code Diff, Unit Tests, Migration Script, API Docs>50* **Acceptance Evidence**:51 - <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>52* **Success Criteria**:53 - <e.g., p95 < 300ms, coverage ≥ 80%>5455## Skill Composition56* **Depends on**: None57* **Compatible with**: None58* **Conflicts with**: None59* **Related Skills**: None6061## Quick Start62#6364## Assumptions65- Users have appropriate permissions for their role66- Override reasons are provided in good faith67- Override correctness can be verified68- Model can be improved from override data6970## Compatibility71- Works with any AI/ML system72- Language-agnostic override patterns73- Can integrate with existing permission systems7475---7677## Test Scenario Matrix78| Scenario | Override Type | Expected Behavior | Notes |79|----------|--------------|-------------------|-------|80| Low-impact decision | Manual | Immediate override | No approval needed |81| High-impact decision | Manual | Requires approval | Manager must approve |82| VIP customer | Business rule | Auto-approve | Rule-based override |83| Emergency | Emergency | Kill switch | Immediate, alerts team |84| Suspicious pattern | Abuse detection | Alert manager | Prevent bulk overrides |8586---8788## Technical Guardrails & Security Threat Model8990### 1. Security & Privacy (Threat Model)91* **Top Threats**: Injection attacks, authentication bypass, data exposure92- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII93- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager94- [ ] **Authorization**: Validate user permissions before state changes9596### 2. Performance & Resources97- [ ] **Execution Efficiency**: Consider time complexity for algorithms98- [ ] **Memory Management**: Use streams/pagination for large data99- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks100101### 3. Architecture & Scalability102- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection103- [ ] **Modularity**: Decouple logic from UI/Frameworks104105### 4. Observability & Reliability106- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`107- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`108- [ ] **Error Handling**: Standardized error codes, no bare except109- [ ] **Observability Artifacts**:110 - **Log Fields**: timestamp, level, message, request_id111 - **Metrics**: request_count, error_count, response_time112 - **Dashboards/Alerts**: High Error Rate > 5%113114115## Agent Directives & Error Recovery116*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*117118- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.119- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.120- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.121- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.122123124## Definition of Done125- [ ] Override permissions defined and implemented126- [ ] Justification requirements enforced127- [ ] Approval workflows for high-impact decisions128- [ ] Comprehensive logging of all overrides129- [ ] Feedback loop to model training130- [ ] Abuse detection and alerting131- [ ] Emergency override mechanism132- [ ] Override analytics dashboard133- [ ] Integration tests passing134- [ ] Documentation complete135136---137138## Anti-patterns / Pitfalls139140* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries141* ⚠️ **Watch out for**: Common symptoms and quick fixes142* 💡 **Instead**: Use proper error handling, pagination, and logging143144145## Reference Links146- [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework)147- [EU AI Act - Human Oversight](https://artificialintelligenceact.eu/)148- [Google's AI Principles](https://ai.google/responsibility/principles/)149150---151152## Versioning & Changelog153154* **Version**: 1.0.0155* **Changelog**:156 - 2026-02-22: Initial version with complete template structure157158---159> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.160<!-- tomevault:4.0:skill_md:2026-04-13 -->