// blog · Security
How to Let Customers Trigger an AI Coding Agent Without Prompt Injection
The safest AI coding agent for customer requests is the one that never reads what the customer wrote. Prompt injection, where text a model reads overrides its instructions, is the first entry in the OWASP Top 10 for LLM applications, and a coding agent that builds features from customer requests reads text from strangers by design. A team can let customers trigger an AI coding agent safely by keeping their raw words away from the agent. A separate AI interview turns each request into a short spec the customer confirms, checks written in plain code decide whether that spec may be built, and the agent works with no network tools, no push access and only two credentials. A person merges before anything reaches production data.
The risk became concrete in 2026. An open-source coding assistant ran an AI issue-triage workflow that any GitHub user could trigger, and an attacker placed instructions in an issue title. The chain that followed poisoned a shared build cache and exposed a publishing token, and on 17 February an unauthorized version of the assistant’s command-line tool stayed on npm for about eight hours. In June, the Cloud Security Alliance described a flaw in a widely used coding-agent GitHub Action that trusted any actor whose name ended in [bot], which let a crafted issue steer the agent toward credentials that could push code.
Most of the guidance written after these incidents speaks to maintainers who let strangers open issues on public repositories. A SaaS team that lets its own customers request features faces the same problem from the inside, because the customer’s text is exactly what the product is meant to act on. The defenses still come from one shared playbook. The table maps the defenses that OWASP, GitHub and the Cloud Security Alliance recommend to the place each one lives in totalmod’s request loop.
| Recommended defense | Recommended by | Where it lives in totalmod |
|---|---|---|
| Keep untrusted free text away from the layer that acts | CSA research note, Jun 2026 | The customer’s raw words stay in the app’s database, and only the confirmed spec goes into the GitHub issue the agent builds from. |
| Enforce policy with deterministic code outside the model | OWASP LLM01, 2025 list | A CI job enforces totalmod.config.yaml, and specs that touch auth, billing, migrations, admin, secrets or CI are declined. |
| Least privilege, with secrets out of the agent’s reach | OWASP, CSA, GitHub Agentic Workflows, Mar 2026 | The agent job receives only the model API key and a scoped GitHub token. |
| Limit the agent’s network access | CSA, GitHub | The agent has no network tools. |
| Vet every write after the agent finishes | GitHub safe outputs | The agent cannot commit or push. CI checks the changed paths against allowed and blocked lists and a 600-line cap, then opens a draft pull request with a risk summary. |
| Sandbox where agent output runs, with secrets removed | Context7 | Previews run on mock data with no production credentials, and only the requester can open the preview link for 24 hours. |
| Require human approval before privileged actions | OWASP, CSA | Nothing reaches production data until the owner merges, and the feature then turns on for the requester first. |
| Screen input for injection patterns | OWASP, Context7 guide, Oct 2026 | Not described in totalmod’s docs. The design relies on isolation, so text that slips past every model still meets the code checks. |
Compiled on 30 November 2026 from each source page and from totalmod’s README, quickstart and AGENTS.md.
One hostile request shows how the layers stack, and the example below illustrates what the documented checks do. A customer of a notes app built on totalmod asks for a word counter and adds a line asking that admins skip the password on login. The raw text stays in the app’s database. The interview writes a spec from it, and if that spec carries the login change, the policy check declines it before any agent runs. If a cleverly worded spec passed that check, the agent would build on a branch with no network tools, and the path check would reject any change to auth code, because auth paths are always blocked. A change that cleared every check would still arrive as a draft pull request, tested on mock data and waiting for the owner.
The limits live in one file, totalmod.config.yaml, and a deterministic job in CI enforces them. With the defaults from the quickstart, the part that bounds a build reads as follows.
requesters: all
budget:
perRequestUsd: 3
monthlyUsd: 100
iterations:
max: 3
paths:
allowed: [app, components, lib]
blocked: []
maxChangedLines: 600
Auth, billing, migrations, .env files and .github stay blocked even when paths.blocked is empty. Production credentials live only in the hosting platform’s production environment and stay out of preview deployments. The repo’s own AGENTS.md states the same rules for anyone who contributes, starting with “Raw user text never reaches the coding agent.”
No layer here makes prompt injection impossible, and OWASP notes that no foolproof prevention is known. The interview model still reads the customer’s words, so its output can be steered, and the design answers that by giving the spec as little power as possible. The agent job also holds two credentials, which is why the scoped token, the missing network tools and the default budgets of $3 per request and $100 a month matter as much as the checks.
At APE AI, where I was co-founder and CTO, the slow path from a user interview to a shipped feature was our real bottleneck. totalmod packages the techniques I used there, and a star on the totalmod repo helps me see how many teams want that loop with the safety layers built in.
Three questions follow from this design. A confirmed spec can still carry an injection, since a model wrote it from the customer’s words, so the policy check, the path check and the line cap run as plain code outside any model. The interview step does read the raw text, and its only output is a spec that the customer confirms and the later checks inspect. The build runs an AI coding agent inside a GitHub Action, and the safety layers sit in CI and configuration, so they hold regardless of what the agent decides.
The loop, its config and the safety rules are open source at sumanprime/totalmod under AGPL-3.0, with a commercial license for teams that need one. The earlier post on letting users build features in a SaaS app covers the full loop, and the hosted demo shows the request side. Teams who want customer requests and a coding agent in the same product can star the repo, and every star shapes what I harden next.