Skip to content

Security and compliance · 12 August 2026 · 3 min read

How do you let AI into your systems without leaking secrets?

Assume the AI can see everything you give it, and give it nothing it doesn’t need. Then back that up with rules your tools enforce, so you aren’t relying on the AI, or a busy engineer, to behave.

In this article
  1. AI inside the product
  2. AI that helps write the code
  3. Know which protections are enforced
  4. Questions to ask about any AI feature

Every software system runs on secrets: database passwords, keys to payment providers, access to cloud accounts. AI tools now read files, run commands and write logs on an engineer’s behalf, which gives those secrets a new way out. In a regulated business, a leaked key can quickly become a reportable incident.

On an internal sales tool we built at Daedalus, we designed for this from the first day, both for the AI inside the product and for the AI that helps us write the code. Here is what that looks like in practice, including the places where it is weaker than it looks.

AI inside the product

The sales tool runs an AI model on its own servers to research companies. Three measures keep it contained:

  • A clean room. The AI runs as a separate process that starts with none of the system’s secrets. It has what it needs to do its job, and nothing sensitive to see.

  • A setup that refuses to go live. One way of running the AI is convenient on an engineer’s laptop and unsafe for customers. The product checks for it at start-up and will not run in production if it is switched on.

  • A limited view of the web. When the AI looks online for evidence, it can only use a short list of approved websites.

The same thinking applies to the product’s guided tour. New users can click through every screen without any risk to real data, because the tour serves example records and the system refuses every change it tries to make, apart from noting that the tour has finished.

AI that helps write the code

Most of our code is now written with AI coding tools, so they need guardrails of their own.

  1. Hard rules. The coding tool is blocked from opening files that hold real secrets, and from commands that would print them. It also can’t run commands that rewrite or wipe the project’s history. The tool itself enforces these rules, and an engineer’s personal settings can’t override them. Example configuration files stay readable on purpose, so the AI can still understand how the system is set up.

  2. Written instructions. The project tells the AI never to read, print or summarise secrets, and to keep real customer data out of code, logs, documents and saved changes.

  3. Limited access. Where the AI can query a database, it connects with read-only access to test data on the engineer’s own machine, so the database itself refuses any change. Its browser can only open local addresses and keeps no saved logins, and the project’s development tools refuse to start unless they point at local services.

  4. Checks before code is saved. A scanner looks for secrets in every change before it is committed. Files that hold secrets are kept out of version control altogether, and any change to the AI’s own rules needs approval from a named owner.

Know which protections are enforced

These layers are not equally strong, and it is worth being clear about which is which.

The hard rules and the read-only database are enforced. The AI can’t get round them, however it behaves. The written instructions are a different kind of protection. They depend on the AI following them, which is why they sit on top of the hard rules rather than replacing them.

The commit check has a weak spot too. If the scanner isn’t installed on an engineer’s machine, it shows a warning and lets the commit through. That is a reasonable trade-off for a small team, as long as everyone knows it only warns.

Knowing which protections are enforced, and which are only expected, is one of the most useful things a security review can tell you.

Most teams have both kinds. Trouble starts when the second kind gets treated as if it were the first, usually because nobody wrote down which was which.

Questions to ask about any AI feature

Whether you are building AI into your product or letting AI tools near your code, these questions are a good place to start:

  • What can the AI see, and does it need all of it?

  • Which rules does the system enforce, and which rely on good behaviour?

  • What stops a risky setting reaching customers by accident?

  • If a secret slipped into a change, what would catch it, and would it block the change or only warn?

  • Who can change the AI’s rules, and who reviews that change?

If the answers are hard to find, that is worth knowing before a customer’s security team asks.

All articles

Read something that sounds like your problem?

A free 15-minute intro with our CEO. Bring the article, and he’ll tell you which service fits, if any. If a spreadsheet and two rules would do the job, we’ll say so.