Keygraph does not retain customer source code in full after analysis completes. Specific fragments required to render findings, deduplicate results, and propose remediations are persisted, and every byte of code-derived state, including any descriptive references to code, is encrypted at rest. This document describes the architectural and operational controls that enforce this posture across our cloud and self-hosted deployment models.
Several Keygraph analysis jobs (SAST, secrets detection, IaC scanning, SCA) require read access to source code. Keygraph performs these operations in short-lived, isolated environments backed by encrypted storage:
Persisted state after a scan consists of structured findings (issue metadata: location, severity, rule ID, fingerprint), a small number of intermediate analysis artifacts required to render and triage findings, and the code snippets explicitly described in the Code Retention section below. All such state is encrypted at rest.
Keygraph requests the minimum scope required for each integration:
The end-to-end repository scanning workflow:
git clone of the target ref into its ephemeral filesystem.The container is single-use. No reuse across repositories, customers, or scan runs.
Keygraph does not persist the full source tree, but a small set of features require retaining specific fragments of code or code-derived data. The categories below are the complete list. All retained data, including any descriptive text that references code, is encrypted at rest.
To display findings in the UI with surrounding context, Keygraph stores short code snippets associated with each issue:
Some scan engines emit intermediate artifacts (for example, dependency graphs, SBOM data, parsed configuration, and engine-specific working state) that are required to produce findings, deduplicate across runs, and support triage workflows.
When Code Remediation is enabled, Keygraph stores diffs for files that are part of a proposed fix:
This data is required to render diffs in the UI and to open pull requests against the source repository.
For each SAST finding, Keygraph stores an Abstract Syntax Tree (AST) representation of the relevant code region. The AST is used for:
ASTs are written to the same tenant-isolated, encrypted-at-rest S3 bucket used for intermediate analysis artifacts. Raw source files are not retained; only the AST fragment associated with the finding.
All retained code-derived data, including code snippets, intermediate artifacts, Code Remediation diffs, SAST ASTs, and any descriptive text that references code, is encrypted at rest using AES-256 with keys managed in a regional KMS. Transport is TLS 1.2+ for all integrations and API traffic.
| Property | Keygraph Cloud | Self-Hosted |
|---|---|---|
| Full source tree stored | No | No (customer controlled) |
| Code-derived data persisted | Snippets, intermediate artifacts, Code Remediation diffs, SAST ASTs (all encrypted) | Customer controlled |
| Network egress | To Keygraph control plane only | Optional / airgap supported |
| Data residency | US or EU region | Customer environment |
| Default integration scope | Read-only | Read-only |
| Container lifecycle | Ephemeral, single-use per scan | Ephemeral, single-use per scan |
| Encryption at rest | AES-256, regional KMS | Customer-managed KMS supported |
| Encryption in transit | TLS 1.2+ | TLS 1.2+ |
Source code should leave the customer's perimeter for the shortest possible duration, only when scanning requires it, and never to a shared or persistent store. Where code-derived state must be retained to deliver a feature, the retained surface is narrow, encrypted, scoped to features the customer explicitly enables, and revocable.
For audit-ready documentation, including encryption key management procedures and incident response, contact security@keygraph.com.