Our solution
Field-level obfuscation at the router
A Custom Module intercepts GraphQL response data before it reaches the client. The renderer replaces field values based on user role or request context. Subgraphs are unaware of the transformation.
How it works
Implement a `CustomFieldValueRenderer` interface in a Cosmo Router Custom Module, written in Go.
The renderer receives each field value with its GraphQL type (String, Int, Float, or custom) and can transform or replace it.
Use the `RouterOnRequest` hook to select different renderers based on authentication claims, user roles, or request headers.
A developer with the "developer" role gets all String fields replaced with "xxx" and numeric fields with placeholders, preserving the response structure.
An AI system identified by a specific header receives placeholder values for any field marked sensitive, while the rest of the response is unaffected.
No subgraph code changes are required. The obfuscation layer lives entirely at the router.
One renderer per role. Zero subgraph changes.

