Privacy, secrets and corporate constraints
The agent puts everything it reads into the context, and the context goes into a model request. So the question is: what information can leave your repo?
Sources that need attention in an Android project:
- Signing keys —
*.jks,*.keystoreand their passwords. - `local.properties` — the SDK path, sometimes keys.
- `google-services.json`,
*.p8,*.p12— service configuration. - `gradle.properties` — sometimes publishing credentials.
- Test data — fixtures containing real user data.
- Log files — user identifiers, tokens, PII.
- Screenshots — real account details can be visible.
{
"permissions": {
"deny": [
"Read(./local.properties)",
"Read(./**/*.jks)",
"Read(./**/*.keystore)",
"Read(./**/*.p8)",
"Read(./**/*.p12)",
"Read(./**/google-services.json)",
"Read(./**/.env)",
"Read(./**/.env.*)",
"Read(./secrets/**)",
"Bash(cat ~/.gradle/gradle.properties)",
"Bash(env)",
"Bash(printenv *)"
]
}
}A `deny` list for an Android project. The last three lines matter: reading environment variables is also a secret-leak path.
| Layer | What it does | Its limit |
|---|---|---|
| `.gitignore` | Keeps secrets out of the repo | The file stays on disk — the agent can still read it |
| `permissions.deny` | Blocks the agent from reading it | Only catches the paths you list |
| Managed settings | A developer cannot override it | Requires organisation-level deployment |
| Secret scanning (CI) | Catches a secret in a commit | It runs after the leak has already happened |
| Attention to context | Sanitise logs and screenshots before pasting | Depends on human habit |
The most-forgotten channel is content you paste by hand. deny rules block the agent from reading, but they don't block a crash log or screenshot you paste into the chat yourself. A stack trace containing real user data must be sanitised first.
In a corporate context further questions arise, and their answers live with legal and security, not with the developer:
- Is sending code to an external service permitted? Under which plan or contract terms?
- Are there separate rules for modules handling customer data?
- What are the data retention terms?
- Which environment is required — the direct API, or the company's own cloud provider?
A practical rule for developers: if you don't know the answers, ask. "I didn't know" is not an answer in a compliance audit. And where a policy exists it should also be enforced technically through managed settings — a policy that lives only in a document doesn't work.
📚 Sources and documentation
- Permission rules and protected pathsofficialcode.claude.com
- Managed settings (organisation level)officialcode.claude.com
Setting rules a developer cannot override.
- App security best practicesofficialdeveloper.android.com