Skip to content
Winter Sale from $619, until 31st December 2026 Book now
Agentic coding tools & comparisons iOS + Android

Security Risks of Agentic Coding: A Threat Model for Mobile App Teams

Coding agents run commands, read untrusted text and often hold the same credentials as the developer who started them. That combination creates four main risks – prompt injection, leaked secrets, malicious or invented dependencies and over-broad permissions – plus ordinary vulnerabilities in the code they write. Mobile teams have extra assets at stake: signing keys, store API keys and the trust of a live app.

8 min read

Key takeaways

  • Agents act, read untrusted input and inherit credentials – any one is manageable, all three together need controls.
  • Signing certificates, App Store Connect keys, upload keystores and Play service accounts should never be readable by an agent.
  • Invented and compromised packages are a real supply-chain risk; new dependencies need a human decision.
  • Permission-bypass modes belong in isolated environments without secrets, not on a developer's main machine.
  • Agents reproduce insecure mobile patterns – token storage, cleartext traffic, open backend rules – so security review stays human.

Why agents change the threat model

An autocomplete tool suggests text; a human decides what runs. A coding agent is different in three ways:

  • It acts. It runs shell commands, installs packages, edits files and pushes branches.
  • It reads untrusted input. Issue descriptions, web pages, dependency READMEs, crash logs and tool output all flow into its context.
  • It inherits credentials. Whatever your shell can reach – environment variables, the keychain, the GitHub CLI token, cloud CLIs – the agent can reach too.

Mobile teams guard some especially valuable assets: the distribution certificate and its private key, App Store Connect API keys, the Android upload keystore, the Google Play service account, push notification keys, backend admin keys – and the developer accounts themselves. Leaked keys can mean unauthorised builds, a long recovery and lost trust in an app people already use.

RiskMobile exampleMain control
Prompt injectionAn issue text instructs the agent to print environment variables into a pull requestNo secrets in the agent's environment; approvals; restricted network
Leaked secretsThe agent "fixes" an API call by embedding a server key in the appDeny rules, CI secrets, secret scanning
DependenciesAn invented or typosquatted package name gets installedApproval for new packages, lockfiles
Over-broad permissionsPermission bypass on a Mac signed in to the Apple accountIsolated environments, scoped tokens
Insecure codeTokens in plain preferences, cleartext traffic allowedSecurity review against a mobile baseline

Prompt injection: when text becomes instructions

A model cannot reliably tell your instructions apart from instructions hidden in the content it reads. The OWASP GenAI Security Project lists prompt injection first among the risks of LLM applications. For coding agents, the entry points are everywhere: a GitHub issue assigned to a cloud agent, a comment on a pull request from a fork, a documentation page the agent fetches, a crash message returned by an MCP server, a note inside a design file, a memory file someone slipped a line into.

You cannot filter every malicious sentence, so limit what a successful injection can do:

  • Keep secrets out of any environment where the agent reads untrusted content. Codex cloud, for example, removes secrets before the agent phase and runs it without internet by default – sensible defaults to keep.
  • Restrict network access for unattended runs to an allowlist of hosts the build actually needs.
  • Keep approvals on for commands that send data, push code or change infrastructure.
  • Have a human triage issues from outside the team before an agent works on them.
  • Review every diff, including changes to memory files, CI workflows and scripts.

Talk to an AI Code Engineer about shipping your app to the App Store and Google Play.

In a free call we look at what you built, tell you honestly what stands between it and an approved release – and whether you need us at all.

Secrets: what agents can read, they can leak

Agents leak secrets in unremarkable ways: printing a config file while debugging, committing a .env file, pasting a key into a test, or – most often in apps – embedding a key in the client to make a failing request work. Anything in an app bundle is public: EXPO_PUBLIC_ variables, Android BuildConfig fields, values in Info.plist and strings in JavaScript bundles can all be extracted.

Controls that work:

  • Deny rules. Block reads of key files in the agent's settings – for Claude Code, deny rules in .claude/settings.json for *.p12, *.p8, *.jks, *.keystore and service account files.
  • Signing lives in CI. Certificates, keystores and store API keys belong in CI secrets or a dedicated signing setup, not in the repository or on the agent's machine.
  • Server-side secrets stay on the server. If the app needs a privileged call, route it through your backend.
  • Secret scanning with push protection on the repository catches what slips through.
  • A rotation plan for every key, so a leak is an afternoon's work rather than a crisis. With Play App Signing, a lost upload key can be reset through Google Play support.

Our playbook on secrets and API keys in AI-built apps goes through each store's keys in detail.

Dependencies: invented, typosquatted and compromised packages

Agents recommend packages from memory. Sometimes the name does not exist – and attackers register plausible names that models tend to invent. Sometimes it is a lookalike of a popular package. And sometimes a real, popular package is compromised.

The last case has already reached coding agents directly. In August 2025, compromised releases of the Nx build system on npm shipped a post-install script that looked for locally installed AI coding CLIs, including Claude Code and Gemini CLI, and invoked them with permission-skipping flags to search the machine for secrets and wallet files. The lesson: an agent configured to run anything without asking is a tool that malware can borrow.

  • Require approval for every new dependency, in npm, CocoaPods or Swift packages, Gradle and pub alike – write the rule into the memory file.
  • Check the registry page before approving: publisher, age, maintenance, download history.
  • Commit lockfiles and install from them in CI (npm ci rather than npm install).
  • Consider disabling npm install scripts where your project allows it, and use automated dependency updates with review.

Permissions and autonomy: limit the blast radius

Every agent offers a way to skip approvals – Claude Code's --dangerously-skip-permissions flag, Gemini CLI's YOLO mode, Codex's full-access mode. They are useful for unattended work and dangerous on the machine where you are logged in to everything. A sensible ladder:

  1. Interactive with approvals on developer machines, with a shared allowlist for routine build and test commands and a deny list for sensitive files.
  2. Sandboxed runs using the tool's own sandbox, a dev container or a VM with no secrets and an egress allowlist.
  3. Cloud agents that work in the provider's containers, end in pull requests and have no merge rights; branch protection does the rest.

iOS adds a twist: builds need macOS. For unattended iOS work, use a dedicated build Mac or a separate macOS user without your Apple ID, personal keychain or browser sessions. Scope tokens the same way: fine-grained GitHub tokens per repository, read-only MCP access, and an App Store Connect API key with the least privileged role that still works – kept in CI, not in the agent's shell.

Insecure patterns agents bring into mobile apps

Agents reproduce what is common in their training data, and common is not the same as secure. Patterns to look for in every review:

  • Auth tokens in UserDefaults or SharedPreferences instead of the Keychain or the Android Keystore.
  • Network errors "fixed" with App Transport Security exceptions or usesCleartextTraffic, or with TLS validation switched off.
  • Exported Android activities, services or receivers without a permission check.
  • Web views with JavaScript bridges that load remote content.
  • Tokens, emails or health data in logs and analytics events.
  • Authorisation that only happens in the app – backend rules left open, row-level security disabled – so anyone with the API URL can read the data.

The OWASP Mobile Application Security project's MASVS gives you a checklist to review against. Our playbooks on auditing AI-generated code and reviewing agent pull requests turn it into a routine.

A minimum control set for an app team

You do not need a security department to use agents safely. Most of the protection comes from a handful of decisions made once and written down: where agents may run, what they may read, what needs approval, and who reviews what. Put the technical parts into the agent settings and the memory file, and the human parts into your pull request template.

jocapps GmbH, the company behind appsubmitter.io, is ISO 27001 certified, and our AI Code Engineers work in customers' own developer accounts with signing kept in CI rather than on agent machines. If you want this set up for your team, our secure agentic coding workshop builds the controls on your own repository, and the iOS submission service takes signing and releases off your developers' machines entirely.

Security baseline for agentic coding in app projects

  • Signing certificates, store API keys, keystores and service accounts are unreadable for agents.
  • Unattended or permission-bypass runs happen only in isolated environments without secrets.
  • Network access for autonomous runs is limited to the hosts the build needs.
  • Issues from outside the team are triaged by a human before an agent works on them.
  • Every new dependency needs approval; lockfiles are committed and used in CI.
  • Secret scanning with push protection is enabled on the repository.
  • Tokens for GitHub, MCP servers and stores are scoped and rotated.
  • Reviews check token storage, network security, exported components and backend rules.
  • Changes to memory files, CI workflows and agent settings get the same review as code.

Frequently asked questions

Is it safe to let a coding agent work on our production app?

Yes, with controls: no access to signing material or production credentials, approvals or a sandbox for commands, pull requests instead of direct pushes, and human review before merge. The risk comes from unlimited access, not from the agent itself.

Does a coding agent send our source code to the model provider?

The parts the agent reads go to the model as context. What the provider stores and whether it trains on it depends on your plan and settings – business and enterprise plans usually offer stricter terms. Check the provider's data usage documentation before rollout.

Should we ban permission-bypass modes?

Ban them on developer machines with real credentials. Allow them in disposable, isolated environments without secrets, where the worst outcome is a broken container rather than a leaked key.

Can you review our agentic coding setup?

Yes. Book a free call with an AI Code Engineer. We look at your agent configuration, secrets handling and release pipeline and recommend concrete controls – or set them up with your team in a workshop.

Free, 15 minutes, no obligation

Get your app from agent output to approved release.

Our AI Code Engineers take apps built with Claude Code, Codex, Cursor, Lovable, Base44 and co. through signing, CI/CD, store listings and review – in your own developer accounts.

AI tools, store policies and requirements change quickly – always check the current documentation of the tools and stores you use. This article is independent advice and not affiliated with or endorsed by Apple, Google, Anthropic, OpenAI or any other company or product mentioned; all trademarks belong to their owners.