Catalog My learning Blog
AI Security Course: OWASP LLM Top 10 2026 and Agentic AI · Phase 3 · Lesson 11 · 4 min read

Excessive Agency and Tool Misuse in AI Agents

On this page
  1. What excessive agency means
  2. SupportBot's tools, before and after
  3. The model requests, the code decides
  4. Check yourself

What excessive agency means

Excessive Agency rose from sixth to third in the 2026 OWASP list, and its agentic twin, ASI02 Tool Misuse and Exploitation, sits in the Agentic Top 10. Both describe one root problem: when the model is wrong or manipulated, the damage is bigger than it had to be, because the model could do more than the job required.

OWASP names three causes:

  • Excessive functionality. Tools the task doesn't need, or tools that do too much: a generic run_sql when you only need order status, a file tool that can delete as well as read.
  • Excessive permissions. Tools running with more authority than needed: a database connection with write access, an email account that can send anywhere, an admin cloud key.
  • Excessive autonomy. Consequential actions with no independent check: refunds, deletions, payments or customer emails executed on the model's word alone.

Tool misuse adds a fourth angle: ordinary tools used for unintended purposes. A search tool pointed at internal hosts becomes server-side request forgery. A ticketing tool becomes a spam cannon. In July 2025 a malicious prompt was merged into version 1.84 of Amazon Q Developer's VS Code extension, telling the agent to use its shell and cloud tools to wipe local files and delete cloud resources. AWS said it didn't execute successfully and removed it, but it showed how normal tools turn destructive under hostile instructions.

SupportBot's tools, before and after

ProblemLab versionFix
Too much functionalitysend_email to any addressreply_to_customer, verified address only
Too many permissionsRefunds use an admin payment keyA scoped key, refunds only on the caller's orders
Too much autonomyAny refund amount runs instantly50 EUR limit, human approval above it
Unconstrained argumentsModel picks order id and amount freelyOwnership check, amount at most the order total
No rate limitsUnlimited refunds per sessionAt most two refunds per customer per day

The model requests, the code decides

Python
from decimal import Decimal

AUTO_REFUND_LIMIT = Decimal("50.00")
MAX_REFUNDS_PER_DAY = 2

def request_refund(session, order_id: str, amount: str, reason: str) -> str:
    order = ORDERS.get(order_id)
    if order is None or order["customer"] != session.verified_email:
        return "No order with that id on your account."
    value = Decimal(amount)
    if value <= 0 or value > Decimal(str(order["total"])):
        return f"Refund must be between 0 and the order total of {order['total']}."
    if refunds_today(session.customer_id) >= MAX_REFUNDS_PER_DAY:
        return "Refund limit reached for today. A human agent will follow up."
    if value > AUTO_REFUND_LIMIT:
        ticket = create_approval_ticket(session.customer_id, order_id, value, reason)
        return f"Refunds above {AUTO_REFUND_LIMIT} need approval. Ticket {ticket} created."
    payments.refund(order_id, value, idempotency_key=f"{order_id}:{value}")   # scoped key
    audit("refund", customer=session.customer_id, order=order_id, amount=str(value), reason=reason)
    return f"Refunded {value} on {order_id}."

def reply_to_customer(session, body: str) -> str:
    """Replaces send_email: the recipient is never a model-supplied value."""
    if len(body) > 4000 or ("http" in body.lower() and not allowed_links_only(body)):
        return "Reply rejected: too long or contains links outside acme.example."
    mailer.send(to=session.verified_email, subject="Your Acme support request", body=body)
    return "Reply sent to the email address on your account."

TOOLS = [
    {"name": "request_refund", "strict": True,
     "description": "Request a refund on one of the customer's own orders. Amounts above 50 EUR "
                    "create an approval ticket instead of refunding.",
     "input_schema": {"type": "object", "additionalProperties": False,
                      "required": ["order_id", "amount", "reason"],
                      "properties": {"order_id": {"type": "string"}, "amount": {"type": "string"},
                                     "reason": {"type": "string"}}}},
    {"name": "reply_to_customer", "strict": True,
     "description": "Email a reply to the customer you are talking to.",
     "input_schema": {"type": "object", "additionalProperties": False, "required": ["body"],
                      "properties": {"body": {"type": "string"}}}},
]

Two attack paths from Day 4 are now closed by construction. P1, exfiltration by email: no argument lets the model choose a recipient, so no injected instruction can redirect mail. P2, refund abuse: the worst case is two small refunds a day on the customer's own orders, and anything larger waits for a person.

Notice the tool description still says "above 50 EUR create an approval ticket". That's for the model, so it explains the process to the customer. The code is what makes it true. A description is guidance; a check is a control.

Check yourself

Replace it with narrow, task-shaped tools if possible. If SQL generation is really needed, use a read-only role limited to the tables the task needs, with row-level security, so even a hijacked query can't write or reach other data.

Money must be exact, and binary floating point can't represent most decimal amounts. Validating the converted value in code also rejects nonsense like negative or oversized amounts, whatever the model sends.

Without it, an attacker who finds an allowed action can repeat it a hundred times. The limit caps the total damage per customer per day.

Each tool does one narrow thing, with parameters validated and limited in code, using credentials scoped to only that action. The agent gets only the tools the task needs.