> For the complete documentation index, see [llms.txt](https://pharaoh.so/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pharaoh.so/docs/use-pharaoh/security.md).

# Security and data

Pharaoh maps repository structure so your AI client can query it. Mapping requires temporary access to source files; the persistent graph contains extracted metadata.

## Repository permissions

The GitHub App reads the repositories you authorize. It can publish GitHub check results, but cannot push commits, edit source files, create branches or open pull requests. GitHub displays the requested permissions before installation. You can review or change repository access in [GitHub's installed-app settings](https://github.com/settings/installations).

## Processing and storage

A mapping or pull-request check clones code into a temporary directory, parses it and deletes the directory when the job finishes, including when the job fails. Startup cleanup removes abandoned job directories after a process interruption.

The graph stores metadata such as:

* Function, class and constant names; file paths and module boundaries.
* Import, dependency and call relationships; complexity scores and line ranges.
* Function-body hashes and file modification dates and change counts.
* HTTP routes, cron schedules, database table names, event names and environment variable names.
* Function signatures, the first line of doc comments and top-level constant values.

Function signatures, short doc comments, route paths and constant values are encrypted with account-derived keys before storage. Source-file bodies, function bodies, environment variable values, and commit messages, authors and diffs are not stored in the graph.

Structural metadata and extracted excerpts can still be sensitive. The [open-source parser](https://github.com/Pharaoh-so/pharaoh-parser) shows what is extracted. Authorized MCP tool calls return graph information to the AI client you connect.

## Access control

Each person authenticates their client with GitHub. Access follows the authorized personal account, organization membership or repository collaborator permissions. Tool calls check repository access against account records in PostgreSQL, and graph queries are scoped to the requested repository.

Removing GitHub access can require cached authorization to expire before an existing session observes the change; revocation is not guaranteed to be instantaneous. Per-account rate limits help control excessive MCP tool usage.

## Encryption and infrastructure

GitHub credentials and the sensitive graph properties listed above are encrypted at rest with AES-256-GCM. Pharaoh derives separate keys for credentials and graph properties using HKDF, the account ID and a server-managed master key. Encryption complements access checks; it does not make the remaining metadata non-sensitive.

Pharaoh uses Render for application hosting and PostgreSQL operational data, Neo4j Aura for the graph, GitHub for authentication and repository access, and Stripe for billing. Stripe handles payment details; Pharaoh does not store card numbers. See the [privacy policy](/docs/use-pharaoh/terms-and-privacy.md#privacy) for data-sharing details.

## Removal

Uninstalling the GitHub App revokes its GitHub access and starts a 30-day retention period for the account's graph and operational data. Reinstalling before deletion can restore the account and its maps. After deletion, reconnecting requires mapping again.

Inactive repository graphs can also be scheduled for deletion after their retention period. See the [privacy policy](/docs/use-pharaoh/terms-and-privacy.md#privacy) for retention, deletion requests and contact information.
