Governed AI Access to a Digital Thread
Project Overview
Anyone who has to let an AI agent near engineering data that not everyone is allowed to see. In nuclear work that includes export-controlled technical data and vendor information shared under NDA.
A read-only MCP server in front of DeepLynx Nexus, Idaho National Laboratory's open-source digital thread platform. An agent can trace a requirement to the components it's allocated to and the tests that verify it, look up parts and vendors, and pull sensor data for a time window.
It has six typed tools and no free-form query tool. Each caller's role decides which tools they can use and which classified records they can see. A hidden record and a record that doesn't exist return the same error.
November 2026.
Nexus runs locally in Docker Compose, built from pinned upstream source. The data is synthetic: a fictional reactor's component cooling water system with 57 records, 95 relationships, and 24 hours of sensor data. The code is on GitHub at alez0101/nexus-governed-mcp.
At work I built governed AI access to our report portal. I wanted to try the same idea on a harder kind of data, where some records are controlled and the controls live in the data platform itself. If access control only lives in the prompt, it isn't access control.
Controls
- One policy module checks every call. It maps the caller's token to a role, checks the tool against that role's allowlist, and validates every argument against a fixed format and size limit.
- Classification uses Nexus's own sensitivity labels. Each role signs in to Nexus as its own read-only account with matching label grants, so Nexus filters first. The policy module then re-checks the labels on every record and withholds anything it can't classify.
- Before anything leaves the server, a final scan blocks the whole response if it contains a record ID or marker that wasn't cleared during that call.
- Every call writes one line to an append-only audit log with the role, the arguments, the result, and the ID of every record returned. Record contents and tokens are never logged.
- The server refuses to start if its Nexus account can read labels the role isn't allowed to see.
What Testing Found
The second layer turned out to matter. One Nexus endpoint, the project-wide edge list, returns the IDs of labeled records to accounts without the label. The server never calls it, and I reported it upstream as #523 on idaholab/DeepLynx.
The validation harness runs 81 checks, including 35 denial paths and a leak sweep across every record as every role. One test points a low-clearance role at a high-clearance Nexus account, so the policy module is the only control. It withheld 55 labeled records with no leaks. That test also caught a bug of mine: the startup check was passing when it should have refused.
The eval set has 20 questions across four roles. Claude answered all 20 correctly through the server, both through Claude Code and through the Anthropic API, with no leaks. Leaks are scored against the answer text and against the server's own audit log.
Still Open
In the first agent run, the model noticed a gap between PRT-1001 and PRT-1003 and mentioned PRT-1002, a record it was never shown. The server leaked nothing, but sequential IDs reveal that something exists in the gap. A prompt instruction fixed it in the next run. That's a mitigation, not a control.
The data is synthetic, it runs on one machine, and the agent evals are a small set run a few times. The GitLab pipeline passes when run locally from a clean clone but hasn't run on a GitLab runner yet.