Preventing Agents from Rewriting Contracts: A Three-Layer Architecture

haandol-_- · reddit · 2026-08-27

The author identifies the risk of 'abstraction inversion' in agent development, where agents update Architecture Decision Records (ADRs) based on current code, effectively rewriting the contract. To solve this, a three-layer architecture is proposed:

The key is treating ADRs as 'contract-complete' and implementation as 'implementation-open'. The author uses open-source plugins alps-writer and adr-writer to enforce this, preventing implementation details from flowing backward and redefining the contract. This also allows stable contracts to serve as reusable Context. The author seeks feedback on handling this in MCP systems.

Original post →

More from coding & agent

coding & agent channel →