Safeguard
Security Guides•

What data should never go into an AI coding assistant?

Credentials, customer data, regulated records and private keys should stay out of AI coding assistants. A simple four-level data rule to apply.

Safeguard Security Team
3 min read

Never put credentials, customer personal data, regulated records, private keys or unreleased security findings into an AI coding assistant, unless your organization has approved that tool for that data class in writing. Source code is a separate decision that depends on contract terms, tool settings and how sensitive the project is.

Why the question matters

OWASP lists sensitive information disclosure as the second risk in its 2025 Top 10 for LLM applications. A coding assistant sends context to a model: the open file, nearby files, chat text and sometimes terminal output. Anything in that context can leave your machine, be logged by the service, or be echoed back in a later suggestion depending on the product and plan.

A four-level data rule

LevelExamplesRule for AI assistants
NeverAPI keys, passwords, private keys, session tokens, production database dumpsBlocked in all tools, no exceptions
RestrictedCustomer personal data, health or payment records, contract termsOnly in tools approved for that class, with a named owner
InternalProprietary source code, internal architecture docsApproved tools on company accounts only
PublicOpen source code, public documentationAllowed

Pick the levels that match your own classification scheme. The point is that developers can place a file in a level in a few seconds.

Places data hides

  • Environment files and local config with live keys.
  • Test fixtures copied from production.
  • Log excerpts pasted into chat to debug a failure.
  • Stack traces that include tokens in URLs or headers.
  • Screenshots of dashboards and consoles.
  • Pending vulnerability reports and unpatched issue details.

Developers rarely paste secrets on purpose. They paste a log to ask what went wrong, and the log happens to contain a bearer token. Teach that case specifically.

Make the safe path easy

Tell people what to do instead. Use synthetic data for fixtures. Redact tokens before pasting. Use a company-approved tool for anything above Public. Where a tool supports it, configure file exclusions so sensitive paths are never read as context, and add pre-commit scanning so a key that does slip through does not reach the repository.

Try it yourself

Click through it at your own pace, or open it full screen.

Run the code scan and read how findings are grouped, then ask which of those files you would never want sent to a model.

Quick check

Is source code allowed in an AI assistant?

It depends on the tool, the plan and your contract. Decide per tool and per project, and write the decision down.

What if someone already pasted a secret?

Treat it as exposed, rotate it, and check logs for use. Do not wait to find out whether the vendor kept it.

Safeguard offers SBOM and dependency scanning plus policies and gates that block risky changes before merge, and you can try a scan free at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.