Every security team that evaluates an AI product eventually asks the same three questions. Where does my prompt go? What gets written down along the way? And how long does it stay there? For a code security platform the questions are sharper, because the prompt is often source code, a stack trace with a connection string in it, or a description of a vulnerability that has not been fixed yet. Privacy and legal teams add a fourth question: who else, besides the vendor, gets to see it?
"Zero data retention" is the phrase the industry has settled on for the best answer to those questions. It is also one of the most loosely used phrases in enterprise software. Some vendors mean that a model provider does not keep your prompt for abuse monitoring. Some mean that the product does not save your chat history. Some mean that nothing leaves your network at all. These are different promises with different threat models, and a buyer who does not separate them can sign a contract that says one thing and get another.
This post sets out how Safeguard handles each path your data can take, what is stored, for how long and where, and which controls you turn on to reach zero retention for the paths you care about. It is written for the security architect, the privacy officer and the lawyer who will each read the same data processing agreement with different questions in mind. Where a control is configured by an administrator, we show where. Where a control is still rolling out, we say so plainly.
What zero data retention actually means
A useful definition has to be specific about three things: which data, which party, and which store.
Which data. For an AI-assisted security platform, the sensitive content falls into a few groups:
- Prompts and conversation turns. The question a person types, plus anything attached to it: selected code, a file, a log excerpt.
- Model outputs. The answer, the generated query, the proposed patch.
- Source code under scan. The repository or file that a scanner reads.
- Scan results. Findings, SBOMs, vulnerability records and the evidence attached to them, which can include code snippets.
- Operational metadata. Who made a request, when, with which model, how many tokens and how long it took.
Which party. Content can be retained by the platform vendor, by a model provider the vendor calls, by a sub-processor that hosts the vendor's infrastructure, or by tools on the user's own machine.
Which store. Retention hides in more places than the obvious database: conversation history, caches, application logs, traces, analytics events, search indices, object storage, backups and snapshots.
With those in hand, a precise statement of zero data retention for AI content reads like this: the text of a prompt and the text of the model's answer are processed in memory to produce a response, and are not written to any durable store by the vendor or by any model provider, beyond short-lived caches needed to serve the request. Metadata such as token counts and timestamps is normally kept, because billing, rate limits and audit depend on it. A definition that claims no metadata at all is usually not describing a real system.
That definition is the one this post uses. It is deliberately strict, and it is why the rest of the post is organised path by path rather than as a single yes or no.
The threat model
Retention is a risk because stored content becomes reachable content. The cases that matter in practice are these.
Breach of the vendor. An attacker who reaches a vendor's conversation store reaches every prompt every customer ever typed into it. Security prompts are dense with exactly what an attacker wants: internal hostnames, unpatched findings, snippets of authentication code, sometimes live secrets pasted by mistake.
Breach of a model provider. If a vendor forwards prompts to a hosted model and that provider keeps them, even for a short abuse-monitoring window, the provider becomes a second place your data can leak from. You did not choose that provider, and you may not have a contract with it.
Insider access. Support engineers, operators and contractors at the vendor or the provider can, in principle, read stored content. Access controls reduce the risk; not storing the content removes it.
Legal process and discovery. Stored data can be subpoenaed, preserved under a litigation hold, or requested by a regulator. Data that was never written cannot be produced.
Secondary use. Content kept for one purpose can drift into another, most commonly model training or product analytics, unless a commitment and a control stop it.
Residency and transfer. Every copy of the data sits somewhere. Each copy adds a location to your transfer impact assessment and a sub-processor to your register.
Backups outliving deletion. Content deleted from a live system can survive in snapshots for weeks or months. The cleanest way to keep content out of backups is never to write it in the first place.
Zero data retention is a control against all of these at once, which is why regulated buyers ask for it before they ask about features. It is also why the control has to be placed carefully. A product that deletes chat history after 30 days still exposes every prompt to its model provider. A product that uses a no-retention model provider but keeps every conversation forever has solved the wrong half.
How Safeguard handles each data path
Safeguard has several surfaces where content flows: the assistant in the web app, the Safeguard CLI and its coding agent, the IDE extension, the MCP server that external assistants use, and the scanners themselves. Below is what happens on each.
The assistant in the web app
The assistant answers questions about your software estate in plain language. A typical turn takes a prompt, translates it into a structured query over your tenant's data, runs that query, and writes an answer.
Standard conversations are saved to your history. By default a conversation is kept so you can return to it, star it, share it with a colleague and continue it later. It is stored in an index that belongs to your tenant and product. This is the behaviour most people want for day to day work, and it is the behaviour you change when the content is sensitive.
Private chat writes no history. The search page has a Private chat toggle. When it is on, each turn is sent with a private flag and the AI service skips both writes it normally makes: the conversation record and the per-conversation context snapshot. The server enforces this through a single check that every persistence site in the request path consults, and it holds even if a conversation identifier is present in the request. The response is marked private, it carries no conversation identifier, and saving or starring the query is switched off in the interface. Authentication, role-based access, tenant scoping and tool execution are unaffected, so a private turn sees exactly the data a normal turn would.
What still exists for a private turn. We would rather you hear the details from us than discover them in an audit:
- A short-lived conversation context in Redis exists only for standard turns and expires after one hour. Private turns do not write it.
- The service keeps a cache that maps a prompt to the structured query it translated into, so that the same question does not pay for the same model call twice. The cache key is a hash of the prompt combined with the tenant and model, the value is the structured query only (never the results), and the entry expires after 24 hours. Answers are always computed live against your data.
- Request metadata (who, when, which model, how long) is recorded for audit and usage, without the prompt text.
The AI service does not write prompt text to its application logs at the default log level. Credential-bearing parameters in request lines, such as short-lived tickets and signed download links, are redacted before log lines are written.
Choosing where the model runs
Where the model runs decides which parties see a prompt. Safeguard offers four choices, and a tenant administrator decides which of them people in the organisation may use.
Zero: no model at all. Zero is a model family that uses no language model. The prompt is analysed inside the Safeguard service by a deterministic translator and turned into the same structured query a model would have produced. Nothing is sent to any model provider, no tokens are consumed, and the same prompt always yields the same query. When Zero cannot read a prompt, it says so and lists the shapes it does read. It never quietly hands the prompt to a language model, because that would break the one promise the family exists to keep. Zero is the right choice for teams with a hard no-AI policy, and for any question whose wording itself is sensitive.
Safeguard's hosted model tiers. Griffin, Eagle and Lion are Safeguard's model tiers in the cloud. They run on open-weight models served through a hosted inference provider that acts as a sub-processor for Safeguard. They are the default because they give the broadest coverage, and they are appropriate for most commercial work. If your policy requires that no third party process prompt text, choose Zero, your own model, or local and on-prem inference instead.
Your own model. A tenant administrator can add the organisation's own model endpoint: a self-hosted server such as vLLM or Ollama, or a frontier model under the organisation's own agreement with Anthropic, OpenAI, Mistral or another provider that speaks the OpenAI or Anthropic API. The model's credential is held by reference in the credential store and fetched at call time. It is never stored alongside the model configuration and never written to logs. When a person picks the organisation's model, inference goes to that endpoint under the organisation's own contract, which is where a provider-level zero data retention agreement you already hold applies. If the chosen model cannot be reached, the request fails with a clear error; it is never silently answered by a different model.
Local and on-prem inference. Inference can run on a model inside your own boundary, either on a developer's machine through the Safeguard CLI and IDE extension, or on servers in your own data centre. Both are described in detail below.
Administrators decide which models are allowed. In Settings, under AI models, a tenant administrator sees every model and voice the organisation is entitled to and can switch each one off for the whole organisation. An administrator who wants an assistant that never calls a hosted model switches off the hosted tiers and leaves Zero and the organisation's own model on. The choice is enforced at the API boundary, not only in the interface, because anyone with an API key could otherwise send a model identifier directly. Each request is checked against the organisation's effective list, which is cached for about a minute, so a change takes effect while the administrator is still looking at the screen.
The Safeguard CLI and its coding agent
The CLI does two very different jobs, scanning and agentic coding, and they handle data differently.
Local scanning sends results, not source. With safeguard ci scan --local, the scan runs on your CI runner or workstation and only the result files are uploaded to Safeguard. Source code stays where it is. SAST findings produced this way have their quoted source lines stripped by default, so a finding carries the file, line, rule and data-flow trace without the code itself. If your team wants snippets in the console for convenience, setting SAFEGUARD_UPLOAD_CODE_SNIPPETS turns them on.
Standalone scans can stay entirely local. safeguard scan writes its results to a local output directory. Uploading is opt-in and can be pointed at your own storage bucket with --upload-to-s3. Artifact scans default to no upload.
The coding agent sends turns to the platform by default. A normal agent turn goes to the Safeguard API and is answered by the platform's model chain. Session history is saved to your Safeguard workspace so that /resume, the web view and audit keep working. On the developer's machine the CLI keeps sessions and per-turn logs in the user's home and workspace directories, with the turn log directory readable only by the user. The copy of a turn's tool output that is relayed to the server is masked and capped in size.
Local model support moves inference to your machine or network. Once local model support is enabled for your organisation, a developer types /local in the terminal app or runs:
safeguard model local setup
The CLI checks the machine's memory, CPU, GPU and disk, recommends a model size, and can pull it through Ollama. Or point it at a server you already run:
safeguard model local set --url http://localhost:11434/v1 --model qwen2.5-coder:14b
Any server that speaks the OpenAI chat completions API works, including Ollama, LM Studio, vLLM and the llama.cpp server. By default only loopback and private network addresses are accepted; a public address requires HTTPS and an explicit --allow-remote flag. The Safeguard platform token is never sent to the model's endpoint. Local turns use no platform inference tokens. Two details matter for a retention review. First, only inference moves: the conversation history still saves to your Safeguard workspace, which is what makes sessions resumable. Second, an organisation can switch the option off centrally, and a machine can be locked out of it with SAFEGUARD_LOCAL_MODEL_DISABLED=1.
The IDE extension
The IDE extension offers two AI features. Scan selection or file sends the selected code, its file path and language to the Safeguard API for analysis. Chat sends the prompt, the current selection and any files the developer explicitly mentions with @. The extension's asset discovery does not upload code snippets unless uploadAssetCodeSnippets is turned on; it is off by default. The same local model support as the CLI is available in the extension through safeguard.localModel.enabled, with the same address rules and the same rule that the platform token never reaches the model.
The MCP server
External assistants such as Claude, ChatGPT and Cursor drive Safeguard through its MCP server. Every tool call is audited, and the audit record is designed to be useful without holding content: it records the tool name, the names of the top-level arguments but never their values, the outcome, the error class, the duration, the client and one target identifier. It never records the result text or error text. Application logs record the tool name at the default level, and keys that look like secrets (tokens, passwords, API keys, webhook URLs, connection strings) are masked if they ever reach a log line.
Server-side scans
When Safeguard scans a connected repository on its own infrastructure, the repository is cloned into a temporary directory that is removed when the scan finishes, and the job's working files are removed after the results are uploaded. The results themselves (findings, SBOMs, vulnerability records and their evidence) are kept, because they are the product: dashboards, trends, policy gates and fix pull requests all depend on them. Deleting a project removes its scan data across every per-project index.
For teams that want no source on Safeguard infrastructure at all, local scanning with the CLI is the answer, and it produces the same findings.
AI telemetry and AI asset discovery
Safeguard can ingest OpenTelemetry from your own AI applications to inventory models, agents and tool use. Content capture is off by default, so prompt and completion bodies are not stored unless you turn it on for a specific ingestion token. Each record carries a retention date, 30 days by default and configurable from 1 to 365 days per token, and a background job deletes expired records. AI asset discovery keeps activity for 30 days and the asset inventory for 90 days by default, both configurable per organisation.
No training on customer data
Safeguard does not use customer code, prompts, outputs, SBOMs or telemetry to train models. This commitment is published in the Safeguard Trust Center. It applies to Safeguard's own model work. When you bring your own provider, that provider's training terms apply, and the major providers' commercial API terms are summarised in the comparison section below.
The Inference API: zero data retention as a routing rule
Safeguard also offers model access through an OpenAI-compatible Inference API, so teams can call many models with one key, one bill and one set of controls. Zero data retention there works as a routing rule, and it is rolling out over the coming weeks. How it works:
- A request can ask for zero data retention, or an account can require it for every request. The gateway then considers only models whose provider offers zero data retention, and refuses the request with a clear message if none qualifies. It never falls back to a model that does not.
- On provider routes that support it, the gateway also sends the provider's own no-store parameter.
- Storing prompt and output text is off by default. An account administrator can turn it on for debugging and delete stored text at any time.
- The request log keeps metadata only: model, route, token counts, cost, latency and whether zero data retention was required.
The documentation for this is at docs.safeguard.sh under Console, Zero data retention, and we will announce availability when it is switched on for customers.
Deployment choices and what each gives you
Zero data retention is easier when the system that might retain data is yours. Safeguard deploys four ways, and the right one depends on how strict your policy is.
SaaS. The fastest start. Tenant data is isolated per tenant. Use Private chat for sensitive conversations, Zero or your own model for prompts that must not reach a hosted inference provider, and local scanning for repositories whose source should not leave your environment.
Your own cloud or private VPC. A dedicated deployment in an account you control. Every store described in this post (conversation indices, caches, logs, backups) lives in your account, under your keys and your retention policies. Your cloud provider is the only infrastructure sub-processor.
On-premises. The full platform in your own data centre. Self-hosted deployments can run with on-prem AI only mode, which turns "we only use our own model" from a configuration promise into a property of the running service:
- Every model call, on every path in the AI service (the assistant, the agent loop, an organisation model, an administrator-set tier endpoint, the Inference API), is checked against its destination just before it is sent. Only on-network hosts are allowed: names you list explicitly, or, if you list none, loopback, private and link-local addresses, single-label container names and internal domain suffixes. A known hosted AI provider is refused even if someone adds it to the list.
- A process-wide guard refuses any outbound HTTP request to a known hosted AI, speech or web search provider before a connection is opened, so a code path that builds its own client cannot reach one either.
- Web search is switched off, because it would carry prompts to the internet.
- Every refusal is logged as a single
onprem_ai_blockedline naming where it happened, the host and a reason. Never a key, a prompt or a query string. - A built-in check,
python -m common.onprem_ai --check, prints any configuration that would be refused at runtime, so operators can verify the setup before go-live.
The reference deployment profile runs the model server, either Ollama on CPU for pilots or vLLM on GPUs for production sizes, on an internal network with no route out, loaded from weights you copy in.
Local inference on developer machines. The CLI and IDE local model described above. It suits teams that want AI help in the editor with inference that never leaves the laptop or the internal network, while keeping the team's shared history and audit in Safeguard.
A practical way to choose:
| If your policy says | Use |
|---|---|
| Sensitive conversations must not be saved | Private chat |
| Prompt text must not reach any AI model | Zero, with hosted tiers switched off in Settings, AI models |
| Prompt text may reach only our approved provider under our contract | Your own model, with hosted tiers switched off |
| Inference must stay on our network | Local model in the CLI and IDE, or on-premises with on-prem AI only mode |
| Source code must not leave our environment | safeguard ci scan --local or safeguard scan, snippets off |
| No Safeguard-operated storage at all | Your own cloud, VPC or on-premises deployment |
How to configure it, step by step
The following checklist takes a SaaS tenant to the strictest configuration available without a dedicated deployment. Each step is independent, so adopt the ones your policy requires.
1. Decide which models are allowed. Open Settings, then AI models. Switch off any hosted model tier your policy does not allow. Leave Zero on if you want a no-model option available to everyone. The change applies to every member of the organisation and is enforced on the API.
2. Add your organisation's own model, if you have one. On the same page, add a model: give it a label, choose the protocol (OpenAI-compatible or Anthropic), the model identifier and the endpoint, and reference the credential from the credential store. Members will see it in the model picker.
3. Make Private chat the habit for sensitive work. Show your team the Private chat toggle on the search page. A private conversation is labelled "Private chat: won't be saved", and saving or starring a query is not offered.
4. Turn on local model support for developers who need it. Ask your Safeguard contact to enable local model support for the organisation. Developers then run safeguard model local setup or set safeguard.localModel.enabled in the IDE. If a group of machines must never use a local model, set SAFEGUARD_LOCAL_MODEL_DISABLED=1 on them.
5. Move source-sensitive repositories to local scanning. In CI, replace a server-side scan with:
safeguard ci scan --local
Leave SAFEGUARD_UPLOAD_CODE_SNIPPETS unset so findings arrive without quoted code.
6. Keep AI telemetry content capture off. If you ingest OpenTelemetry from your own AI applications, leave content capture off on each ingestion token and set the retention window your policy requires, between 1 and 365 days.
7. Record the configuration as evidence. Each of these settings is an auditable control. Safeguard's compliance suite can hold the screenshots, settings exports and policy text as evidence against the controls listed in the mapping below.
For self-hosted deployments, add two steps: set ONPREM_AI_ONLY=true with the allowed model hosts for the AI service, and run the configuration check before go-live.
How common industry approaches compare
Zero data retention is not a single product feature anywhere in the market. It is a combination of provider terms and product design. Here is how three widely used services describe their own defaults, taken from their public documentation on 28 November 2026. We include them because many Safeguard customers bring their own model from these providers, and the provider's terms then govern inference.
OpenAI API. OpenAI's data controls documentation says API data is not used to train its models by default, and that abuse monitoring logs are kept for up to 30 days. Zero data retention, which excludes customer content from those logs, is available subject to prior approval by OpenAI, and customers contact OpenAI sales to check eligibility. Source: OpenAI, Your data.
Anthropic API. Anthropic's privacy center says API inputs and outputs are deleted from its back end within 30 days of receipt or generation, with exceptions that include a separate agreement with the customer, which is how zero data retention arrangements are made. Source: Anthropic privacy center, how long do you store my organization's data.
GitHub Copilot Business and Enterprise. GitHub's Copilot Trust Center FAQ says prompts and suggestions from code completion and chat in the IDE, the Copilot app and the CLI are not retained by default, while inputs and outputs from other access methods are retained for the life of the account. It also says GitHub does not use Copilot Business or Enterprise customer data to train AI models. Source: GitHub Copilot Trust Center FAQ.
Three patterns follow from these and from the rest of the market.
Provider-side zero data retention by agreement. The model provider does not keep content, usually after an eligibility review. This protects against the provider becoming a second store, and it is excellent when you can get it. It does nothing about what the application in front of the model stores.
Surface-specific retention. Some products keep nothing from one surface, such as editor completions, and keep everything from another, such as web chat. That is a reasonable design, and it means a buyer has to ask the question per surface.
Customer-hosted inference. The model runs in the customer's environment, so no provider is involved. This gives the strongest assurance for inference, at the cost of running the model.
Safeguard's approach combines all three and adds the parts that are specific to a security platform. Private chat handles the application side for conversations. Your own model lets an existing provider agreement, including a zero data retention agreement, govern inference. Local and on-prem inference removes the provider entirely. Zero removes the model entirely, which is an option you rarely see from AI vendors. And local scanning keeps source code out of the vendor's environment, which matters as much as prompts do for a code security product.
When you compare vendors, ask each one the same five questions:
- Which surfaces store conversation content, and for how long?
- Which model providers can see my prompts, and on what terms?
- Can an administrator restrict models for the whole organisation, and is that enforced on the API?
- Can I run inference inside my own boundary, and what is guaranteed when I do?
- Does scanning require my source code to leave my environment?
Compliance mapping
The controls above help you meet obligations in several frameworks. This is a mapping of Safeguard capabilities to control objectives that your own program owns, not a certification of your environment. Safeguard itself is SOC 2 Type I and Type II audited, and the reports are available on request through the Safeguard Trust Center.
| Framework | Relevant requirement | Safeguard controls that support it |
|---|---|---|
| SOC 2 (Trust Services Criteria) | CC6.1 logical access, CC6.7 transmission and movement of data, C1.1 and C1.2 identification, retention and disposal of confidential information | Tenant isolation, administrator model restrictions enforced on the API, Private chat, local scanning, project deletion across scan indices |
| ISO/IEC 27001:2022 | Annex A 5.23 information security for use of cloud services, 5.34 privacy and protection of PII, 8.10 information deletion, 8.11 data masking, 8.12 data leakage prevention | Private chat, snippet stripping in local scans, on-prem AI only mode, MCP audit without argument values, secret masking in logs |
| GDPR | Article 5(1)(c) data minimisation, 5(1)(e) storage limitation, Article 25 data protection by design and by default, Article 28 processors, Article 32 security of processing | Private chat, Zero, your own model under your own processor terms, local and on-prem inference, AI telemetry content capture off by default with retention windows |
| HIPAA Security Rule | 164.312(a) access control, 164.312(b) audit controls, 164.312(e) transmission security, and the minimum necessary standard in 164.502(b) | Administrator model restrictions, request metadata audit without content, on-prem AI only mode, local scanning |
| India DPDP Act 2023 | Section 8(7) erasure when the purpose is served, and reasonable security safeguards in Section 8(5) | Private chat, Zero, on-prem deployment, retention windows for AI telemetry |
| EU AI Act | Article 10 data governance for high-risk systems, and transparency on how AI components handle data | Model inventory and AI asset discovery, explicit model choice per organisation, Zero as a no-model option |
| PCI DSS v4.0 | Requirement 3.2 keep account data storage to a minimum, Requirement 10 log and monitor access | Snippet stripping, local scanning, secret masking in logs, audit records |
For each mapping, the evidence is the configuration itself: the AI models settings page, the CI configuration that uses local scanning, the deployment manifest for on-prem AI only mode and the retention settings on telemetry tokens. Safeguard's compliance suite can collect and keep that evidence alongside the control.
Frequently asked questions
Does Safeguard offer zero data retention? Yes, for the paths you configure. Private chat keeps conversations out of history, Zero keeps prompts away from every model, your own model keeps inference under your own provider agreement, local and on-prem inference keep it inside your network, and local scanning keeps source code in your environment. For the Inference API, zero data retention routing is rolling out over the coming weeks.
If I use Private chat, is anything at all stored? No conversation record and no conversation context are written. Request metadata is kept for audit and usage. A 24-hour cache maps a hash of the prompt to the structured query it produced, so a repeated question is answered faster; it holds no results. Selecting Zero skips that cache as well.
Are my prompts used to train models? No. Safeguard does not use customer data to train models. When you use your own provider, that provider's terms apply; OpenAI and GitHub, for example, state in the pages cited above that they do not train on business customers' API or Copilot data by default.
Which party sees my prompt when I use the default model? Safeguard and the hosted inference provider that serves Safeguard's model tiers. If your policy does not allow that, use Zero, your own model, or local and on-prem inference, and switch the hosted tiers off for the organisation.
Can an administrator force these choices for everyone? Yes for models. An administrator switches model tiers off in Settings, AI models, and the restriction is enforced on the API. Private chat is chosen per conversation by the person asking.
Does the CLI coding agent keep history when I use a local model? Yes. Only inference moves to your model. History saves to your Safeguard workspace so that sessions can be resumed and audited. For no-model questions about your estate, use Zero in the web app.
Does scanning require uploading my source code?
No. safeguard ci scan --local and safeguard scan run where your code is and upload results only, with quoted code stripped from findings by default.
What happens to my code when Safeguard scans a connected repository? It is cloned into a temporary directory that is removed when the scan ends. The findings and SBOMs are kept, because the platform's dashboards, gates and fixes are built on them.
What does the MCP server log when an AI assistant calls Safeguard? The tool name, the names of the arguments, the outcome and the timing. Not the argument values and not the results.
Can we run Safeguard with no external AI calls at all? Yes. Deploy Safeguard on-premises or in your own cloud with on-prem AI only mode and a model you host, or use Zero with no model at all. In on-prem AI only mode, any attempt to reach a hosted AI provider is refused and logged.
Is local inference good enough for real work? It depends on the model you can host. Larger open-weight coding models are strong for everyday work; the smallest are best for small edits and questions. The CLI recommends a size for each machine and lets you choose.
Where is Safeguard's data processing documented? In the Safeguard Trust Center, which lists sub-processors, the AI governance commitments and the SOC 2 Type I and Type II reports, available on request.
Where to start
Most teams do not need every control on day one. A sensible first week is to switch off any model tier your policy does not allow, show the team the Private chat toggle, and move the two or three repositories with the most sensitive code to local scanning. A sensible first quarter adds your own model or local inference for developers and, where policy requires it, a dedicated or on-premises deployment with on-prem AI only mode.
Zero data retention is not a slogan you buy. It is a set of decisions about where data goes, each one testable. Safeguard gives you the controls to make those decisions per path and the evidence to show an auditor that you made them. To walk through your own requirements with the team, visit safeguard.sh or read the AI governance section of the Safeguard Trust Center.