# What is Self-Correction? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Agentic Systems  
> **Canonical Citation:** [https://spidits.com/ai-glossary/self-correction](https://spidits.com/ai-glossary/self-correction)

## Definition
Self-Correction is an agentic design pattern where an AI agent executes a task, validates the intermediate output (against unit tests, syntax linters, or criteria checklists), and recursively loops to edit and resolve mistakes when errors are found.

## Architectural Mechanics & Deep Dive
Self-correction is an agentic AI capability where a model reviews its own generated outputs, identifies errors or logical inconsistencies (such as failing unit tests or compilation warnings), and modifies its response to resolve the issues. This iterative reasoning loop (reflect-and-act) dramatically increases success rates in software writing and logical problem-solving.

## Industry Applications & Real-World Use Cases
Automated software debugging, self-healing code runs, and automated data entry verification.

## Frequently Asked Questions

### How does self-correction work in coding agents?
The agent writes code, runs a shell command to compile it, reads any compile error outputs in the terminal sandbox, and prompts itself with the error stack to fix the script.

### What is the limit of self-correction?
If the agent lacks capability, it can get stuck in infinite correction loops, which must be halted by step limits or human feedback triggers.

## Related Terminology
- [loop-engineering](https://spidits.com/ai-glossary/loop-engineering)
- [cognitive-architecture](https://spidits.com/ai-glossary/cognitive-architecture)
- [ai-agent](https://spidits.com/ai-glossary/ai-agent)

---
*From the SPIDITS AI Knowledge Base (336+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
