An anticorruption layer is a protective translator at a system boundary. It converts an external system’s data into the application core’s language, keeping API details and database schemas from leaking into business logic. section 5.3.3
Without that boundary, the core can end up speaking a vendor’s language. In hexagonal architecture, an adapter can do the translation instead: incoming adapters convert outside requests for a core port, while outgoing adapters implement core ports to communicate with infrastructure. The dependency points toward the core, even when data flows outward. section 5.3.3
Figure 5.6 Adapters translate the messy language of the outside world (JSON, SQL) into the clean language of the Core, and back again.

The diagram illustrates adapters translating between external formats and the core’s language. section 5.3.3
An order at the boundary
An order controller unpacks a JSON HTTP request and calls the order service through a primary port. On the other side, a SQL order repository implements a secondary port and translates an Order object into database statements. These adapters keep transport and storage details outside the core. section 5.3.3
The boundary can also filter outgoing data. Before a payload leaves the backend, mask sensitive fields and limit it to what the recipient needs. Hiding fields in the user interface is not enough if the API has already sent the entire user object. section 11.7.1 section 11.6
Assign an owner to each external integration and document its threat model and mitigations in an architecture decision record. Revisit those decisions regularly and after major integration changes so the boundary does not quietly become outdated. section 11.7.1




