AI agent security comes down to one idea: an agent is only as dangerous as the tools, data and credentials you give it, and anything it reads can try to take control of it. A chatbot that answers questions can embarrass you. An agent that can send email, query your database, issue refunds or push code can be talked into doing those things for someone else. You can't make the model itself trustworthy, so you secure what sits around it: narrow permissions, server-side checks, a human approval step for anything that can't be undone, and logs you can actually read.
I'm Kunal Vohra. I have an M.Tech in Cybersecurity from NIT Kurukshetra, I've published on prompt injection, and I run ColadAI, a multi-LLM platform, so I make these calls on my own products before I recommend them to anyone. This is the version of agent security that fits inside a startup's first launch.
What AI agent security actually means
An AI agent is a model that can take actions: call tools, hit APIs, read and write data, and decide its own next step. AI agent security is the work of making sure those actions only happen for the right user, on the right data, within limits you set, even when the model is confused, wrong or deliberately manipulated.
That framing matters because it moves the problem out of the prompt. The most common mistake I see is treating the system prompt as the security boundary: "You must never reveal customer data" or "Only refund orders under $50." Those lines are instructions, not controls. A model follows them most of the time, and "most of the time" is not a security property. The boundary has to live in code the model can't talk to.
The sentence I'd put on the wall of every AI team: the blast radius of an AI agent is the sum of its permissions, not the quality of its prompt. If the worst thing an agent can do is draft a reply for a human to approve, prompt injection is a nuisance. If it can move money, it's an incident.
The five AI agent security risks that matter for a startup
For a startup shipping its first agent, five risks cover nearly everything I check, and each has a concrete fix.
1. Prompt injection, direct and indirect. Direct injection is a user typing instructions to override yours. Indirect injection is worse for agents: the instructions arrive inside content the agent reads on someone else's behalf, such as an email, a web page, a support ticket, a PDF or a retrieved document. The agent can't reliably tell your instructions from the attacker's, because to the model it's all text. I covered the mechanics in Prompt Injection Attacks Explained.
2. Excessive agency. The agent has more tools, broader scopes or stronger credentials than its job needs. It is usually a week-one convenience ("just use the admin key for now") that turns every other risk here from a bug into a breach.
3. Data exfiltration. An injected instruction gets the agent to send data somewhere it shouldn't: into an outgoing email, a URL it fetches, a link it renders, or a tool call to an external service. It only needs one tool that can send data out and one piece of content that tells it to.
4. Confused deputy and broken tenancy. The agent acts with its own service-level permissions instead of the permissions of the user it's working for. A user who can't see another customer's records asks the agent, and the agent, holding a key that can see everything, helpfully fetches them. In a multi-tenant B2B product this is the risk that ends enterprise deals.
5. Runaway actions and runaway cost. Agents loop. A bad plan, a tool that keeps returning errors, or a malicious input can trigger hundreds of calls: emails sent, records updated, tokens spent. Abuse of an AI endpoint often shows up first as a bill, and an agent can run up that bill on its own.
Notice that only the first risk is specific to language models. The other four are old security problems (least privilege, egress control, authorisation, rate limiting) that an agent makes easier to trigger. That's good news: you already know how to fix them.
Securing AI agents: the permission model I start from
The fastest way to make an agent safe is to decide, tool by tool, what it can do without asking, what it can do with approval, and what it can never do. I sort every tool into three buckets before any code is written.
Read-only tools the agent can call freely. Searching your own knowledge base, reading the current user's own records, checking an order status. Even here, the query runs with the user's permissions, and results are filtered on the server.
Write tools that need a human confirmation. Sending an email or message to a third party, updating a customer record, creating a ticket in someone else's queue. The agent prepares the action; a person sees exactly what will happen and clicks approve.
Actions the agent never takes. Deleting data, moving money above a small fixed limit, changing permissions or credentials, deploying code to production, anything legal or contractual. If the business genuinely needs one of these automated later, it gets its own design review, not a new line in the tool list.
Then four rules apply to every bucket:
- Act as the user, not as the system. Pass the end user's identity and scopes through to every tool call, and enforce authorisation in the tool, the way you would for any API request. The agent should never be able to see more than the person it's helping.
- One agent, one credential, minimum scope. Give each agent its own API keys and service accounts with only the permissions its tools need. Never reuse a human admin's token. When something goes wrong, you want to revoke one key without taking the product down.
- Validate every tool call in code. The model proposes arguments; your code checks them. Is this order ID owned by this user? Is this refund under the limit? Is this email address on an allowed domain? Reject anything that fails, and log it.
- Make tools narrow. "send_refund(order_id)" with a server-side limit is safer than "call_payments_api(endpoint, body)". Every general-purpose tool you expose is a general-purpose tool an attacker can use.
Prompt injection in AI agents: what actually helps
You can't fully prevent prompt injection today, so design as if it will sometimes succeed and make sure success doesn't matter much. Filters and clever system prompts reduce the rate; they don't close the hole.
What does help, in the order I'd apply it:
Separate untrusted content from instructions. Mark retrieved documents, emails and web pages clearly as data in the prompt, and never let untrusted text sit in the same position as your instructions. This lowers the success rate; it is not a guarantee, so the steps below still apply.
Don't let one step both read untrusted content and take a sensitive action. If an agent reads an inbound email, the step that reads it shouldn't also hold the tool that can forward your customer list. Split the work so the part exposed to untrusted input has the weakest tools.
Control egress. Limit which domains the agent can fetch from or send to, strip or neutralise links and images in model output where the product doesn't need them, and treat any tool that sends data outside your system as a write action that needs approval.
Watch for the tell. Injected instructions often show up as tool calls that don't match the user's request: a summarisation task that suddenly wants to send an email. Flag tool calls that fall outside the expected pattern for that task and route them to a human.
Retrieval is an injection route too. If your agent uses RAG, a poisoned document in the index is as dangerous as a malicious email. I wrote about keeping retrieval tenant-safe in RAG vs fine-tuning for startups.
Human in the loop for AI agents: where approval earns its friction
Put a human approval step on any action that is irreversible, external or financial, and nowhere else. Approval on everything trains users to click "yes" without reading, which is worse than no approval at all.
A good approval step shows the exact action, not the agent's summary of it: the recipient, the full message, the amount, the record and the field being changed. It defaults to "no", it expires, and it's logged with who approved what, because "the AI did it" is not an answer a customer accepts.
The trade-off founders worry about is that approvals make the product feel less magical. In my experience the opposite holds for B2B buyers: an agent that drafts and waits is easier to sell than one that acts alone, because the buyer's security team has to sign off on it. You can remove approvals for specific actions later, once logs show the agent gets them right, and that is a much easier conversation than adding them after an incident.
Logging, monitoring and limits: knowing what your agent did
If you can't reconstruct what an agent did and why, you can't secure it, debug it or defend it in a security review. Log every tool call with the user, the arguments, the result, and the conversation turn that led to it, and keep personal data out of those logs unless the feature needs it.
Then add the limits that stop a bad run from becoming a bad week:
- Step and loop limits on every agent run, so a confused plan stops after a fixed number of tool calls instead of running all night.
- Rate limits per user and per tool, especially on anything that sends messages or writes data.
- Hard spend limits on model keys, set at the provider and alerted on in your own system. My comparison of the major AI APIs covers where each provider lets you set them.
- A kill switch. One flag that disables an agent's write tools without a deploy.
These logs double as your evidence. Investors doing technical due diligence on an AI startup now ask what stops a malicious input from making the product take an action it shouldn't, and "here is the permission model, here are the approval rules, here are the logs" is the strong answer.
An AI agent security checklist for your first launch
Before an agent goes in front of real users, I want a yes to each of these ten:
- Every tool is listed, with its bucket (free, approval, never) written down.
- Tool calls run with the end user's identity and permissions, enforced in code.
- The agent has its own credentials, scoped to the minimum, and none of them belong to a human admin.
- Every tool argument is validated on the server before anything executes.
- Untrusted content (emails, web pages, documents, user uploads) is treated as data, and the step that reads it doesn't hold sensitive tools.
- Outbound data paths (email, HTTP fetches, links in output) are limited and reviewed.
- Irreversible, external and financial actions need a human approval that shows the exact action.
- Runs have step limits; users and tools have rate limits; model keys have spend limits.
- Every tool call is logged with user, arguments, result and approval, without unnecessary personal data.
- There's a kill switch for write tools, and someone knows how to use it.
This sits on top of the basics, not instead of them. Identity, secrets, backups and the rest come first; my startup security checklist has them in the order I fix them, with a shorter AI section that this post expands. For a wider view of how attackers are using AI themselves, see Can AI Hack Systems?.
Who should own AI agent security at a startup?
Whoever owns the architecture should own agent security, because almost every fix is an architecture decision: which tools exist, what credentials they hold, where approvals sit.
For most early AI startups that doesn't need to be a full-time CTO at $180,000 to $260,000 a year plus equity. If you have a team building the agent and want the design checked, a technical advisor retainer ($750 a month for 15+ hours, held through December 2026) covers reviewing the tool list, the permission model and the approval rules before launch. If you need someone to own the AI roadmap, the security posture and the build, that is a fractional CTO engagement ($2,500 a month for 50+ hours on the same terms); the fractional CTO cost guide shows market rates beside mine. And if you're still at the build stage, my team and I build MVPs for AI startups with scoped tools, approvals and cost logging in from the first week; the MVP cost calculator gives a first range, including the security review option.
Frequently asked questions
What is AI agent security? It is the practice of making sure an AI agent's actions (tool calls, API requests, data reads and writes) only happen for the right user, on the right data, within limits you set, even if the model is wrong or manipulated. The controls live in code around the model: permissions, validation, approvals, limits and logs.
What are the biggest AI agent security risks? For a startup, five: prompt injection (especially indirect injection through content the agent reads), excessive agency from over-broad tools and credentials, data exfiltration through any tool that sends data out, confused-deputy access where the agent uses its own permissions instead of the user's, and runaway actions or cost from loops.
Can you prevent prompt injection in an AI agent? Not completely, with today's models. You can lower the success rate by separating untrusted content from instructions, and you can make success harmless by keeping sensitive tools away from steps that read untrusted input, controlling outbound data paths and requiring approval for risky actions.
When does an AI agent need a human in the loop? For any action that is irreversible, reaches outside your system, or moves money: sending external messages, deleting or bulk-changing data, payments, permission changes and deployments. Read-only actions on the user's own data usually don't need it, and approvals on everything teach users to stop reading them.
Is the system prompt a security control? No. Instructions in the system prompt shape behaviour most of the time, but a determined input can override them. Treat them as guidance and enforce every real rule (who can see what, what limits apply) in server-side code the model can't change.
Do investors ask about AI agent security? Increasingly, yes. A technically literate diligence partner will ask what stops a malicious input from making your product take an action it shouldn't. A written permission model, approval rules and tool-call logs make that a short conversation.
If you're about to give an agent real tools, book a 30-minute call. Bring the list of tools you plan to expose, and I'll tell you which ones need approvals, which need narrowing, and which shouldn't exist yet. Or get in touch if you'd rather write first.
Written By
Kunal Vohra
Technical Co-Founder & Fractional CTO
I've co-founded 6+ startups across India, the UAE, and the US, spanning AI, Web3, fintech, and cybersecurity. I write about the technical and strategic decisions that determine whether a startup thrives or stalls.
Comments
Loading comments…