All patterns
P-06 · Patterns

AI over legacy with an anti-corruption layer

AI talks to a clean domain model; a layer translates and protects the legacy system.

legado-com-camada-anticorrupcao.archClick a component in the diagram
Anti-corruption · Validates, translates, rate-limits and logs.
Problem

Connecting AI straight to legacy spreads odd formats into prompts and puts operations at risk with every call.

Solution

An anti-corruption layer exposes clear business operations, with validation, rate limits and data translation, and is the only door to legacy.

When to use
  • →ERPs and mainframes without modern APIs
  • →Critical systems that cannot go down
  • →Gradual migration
## Trade-offs
  • +Protects operations
  • +Simpler prompts and tools
  • +Lets you modernize behind it
  • −One more component to maintain
  • −Data translation can hide nuance