promptfoo red teaming for the OWASP API Security Top 10

Use the promptfoo owasp:api preset to test LLM applications that call tools and APIs for authorization, SSRF and resource consumption failures, and see what the evidence does not cover.

On this page

How promptfoo red teaming for the OWASP API Security Top 10 supports your evidence

If your LLM application or agent calls internal APIs and tools, a review will ask how it was tested against the OWASP API Security Top 10 (2023). promptfoo's owasp:api preset produces test evidence for those API risks, but it does not certify compliance and it does not replace design review. Treat its output as dated probe results that show what was attempted, what was blocked and what got through, alongside your architecture documents and authorization design.

The preset is anchored on API1 Broken Object Level Authorization and API5 Broken Function Level Authorization. promptfoo maps these to LLM applications because function calling and agents place the model between the user and backend systems. A user may ask, in natural language, for another customer's invoice or an admin-only action, and the model can become the path that performs it. The probes try to get the model to reference object identifiers it should not reach and to invoke tools outside the caller's role. The preset also covers the other categories in the 2023 list, so confirm the full mapping in promptfoo's OWASP API Top 10 documentation before you cite a specific API ID in a report.

Before you rely on the results, confirm three things with your own environment. First, that the target you test is the real tool layer, meaning the same tool definitions, permission checks and identity context production uses, not a mock that always returns success. Second, that the test user accounts cover more than one role and tenant, because object-level failures only appear when two identities are compared. Third, that a failed probe leads to a documented fix and a retest. Enforcement of authorization belongs in the backend, so a clean scan shows the model did not leak, not that every endpoint checks ownership.

Mapping OWASP API Top 10 risks to promptfoo tests and configuration

This table compares each OWASP API Security Top 10 (2023) risk the owasp:api preset targets with what it probes in an LLM application and what the target must provide for the test to mean anything. Read each row as a prerequisite checklist: a probe that runs against a target with one shared admin identity proves much less than one run against separate low-privilege test users. Confirm the current preset mapping in the promptfoo OWASP API Top 10 docs before you rely on any row.

RiskWhat the owasp:api preset probesTarget configuration needed
API1 Broken Object Level AuthorizationWhether the model can be steered into reading or changing records that belong to another user through tool calls or API parametersAt least two test user identities with distinct owned records, and tools that pass the caller's identity rather than a shared service account
API5 Broken Function Level AuthorizationWhether a user can get the model to invoke administrative or restricted functions their role should not reachRoles with different tool scopes, a restricted admin-only tool in the test target, and logs that show which function was called
Server-side request forgery (SSRF)Whether the model can be induced to fetch internal addresses, metadata endpoints or unapproved hosts through URL-taking toolsAn allowed outbound host list enforced at the network or proxy layer, plus internal test endpoints that a successful fetch would reveal
Resource consumptionWhether prompts can drive excessive tool calls, large outputs or repeated expensive API requestsRate limits, per-request token and tool-call caps, and timeouts on the target so probe runs show a measurable limit
Other API Top 10 risksListed in the preset only as far as the promptfoo docs confirm; treat any other category as unverifiedConfirm the current mapping in the promptfoo OWASP API Top 10 docs before claiming coverage for a risk not shown here

How the owasp:api preset attacks an LLM that calls backend APIs

The core decision in this section is what the grader is allowed to see. A red team run sends adversarial prompts to the target through its configured provider or HTTP endpoint. The target LLM then decides which tools or API calls to make, and the grader checks whether the response, or the action the target took, crossed an authorization or network boundary. For the owasp:api preset, that boundary is usually a user identity trying to read or change another user's object (API1 Broken Object Level Authorization) or a low-privilege caller reaching an administrative function (API5 Broken Function Level Authorization). Before the first run, confirm how your target reports tool calls. If it only returns final text, a grader can miss an unauthorized call that the model made and then summarized away.

The results are only as meaningful as the identities, tool definitions and backends the target exposes. Use at least two test identities with different ownership of records, and define each tool's parameters so the model can actually form an object reference or a URL. For SSRF and resource consumption checks, point the tools at a mock or staging backend that logs every request, including requests to internal addresses that should be blocked. A target wired to production systems makes the run risky, and a target wired to a stub that always succeeds makes a pass meaningless. Write down which backend each tool calls and what a correct refusal looks like before you read the report.

Nothing in this flow leaves your machine except the traffic to the LLM and the target you configure. promptfoo's documentation states that it runs completely locally, with evals running on your machine and talking directly with the LLM. That matters for this preset because the adversarial prompts, the target's responses and any tool output stay in your environment, which your security and privacy reviewers will ask about. Confirm with your own architecture team which model endpoints the run will call and whether the target's backends are reachable from the machine running the scan.

Where the red team run sits between user, LLM, tools and backend APIs

The run starts on the tester's machine, where the promptfoo CLI sends attack prompts to the target application endpoint, not directly to the model. The application forwards them to the LLM, which may request tool or function calls. Each tool call reaches an internal API, and that is where the test identity must be checked by the authorization layer. The outbound request path marks where SSRF probes would leave the application, so check which hosts the tools can reach.

Test path from the promptfoo CLI through the application, LLM, tools and internal API.

What the owasp:api run produces for auditors and how to keep it

An owasp:api red team run is only useful to an auditor if its inputs, outputs and follow-up can be traced together. The cards below list the artifacts a reviewer will ask for and where each one should live outside the promptfoo server.

Promptfoo config with preset and target

The configuration file records the owasp:api preset, the plugins and strategies selected, and the target definition that points promptfoo at your LLM application and its tool endpoints. Store it in version control so every run can be matched to the exact configuration that produced it. Check that the target block names the real staging or test system, not a production host, and that no API keys are written in plain text inside the file.

OWASP API docs

Red team report with per-probe results

The report shows each probe, the API risk it maps to, the attack it sent and whether the application's response was graded as a failure. Auditors typically look for the failing probes first, so keep the full report and not only a summary score. Export it as a file and archive it with the run, since a report viewed only in a running web session may not survive a server rebuild.

Run date and promptfoo version

Record the date of each run and the exact promptfoo version used. The current npm release, 0.124.1, was published on 8 October 2026 and requires Node.js 22.22.0 or newer, so the Node.js version belongs in the record too. Without these, a reviewer cannot tell whether a result reflects the grading logic in use at the time. Confirm the version you ran with promptfoo --version and capture the Node.js version in the same log.

promptfoo on npm

Test identities and scopes used

Object and function level authorization probes only mean something when the run used named test accounts with known permissions. Document each identity, its role, the resources it owns and the functions it may call, along with the tokens or sessions used. Keep these records in your access management inventory and not in the promptfoo config, and confirm that the test accounts hold no production data and cannot reach real customer records.

Remediation tickets linked to failing probes

Every failing probe should map to a ticket in your issue tracker that names the affected endpoint, the authorization or SSRF control involved and the owner. The link between probe ID and ticket is what turns a scan into evidence of remediation. Include the ticket ID in the run record, and confirm that the owner has reviewed the probe payload so the fix addresses the actual attack path and not a symptom.

Retest results and retention

After a fix ships, rerun the same configuration against the same identities and attach the new report beside the original. Keep both for as long as your audit or contractual retention period requires, which your compliance lead should set. Self-hosted promptfoo stores data in a local SQLite database that cannot be shared across replicas, has no RBAC and is not recommended for production, so write these records to a repository or document system your organization already controls.

Self-hosting docs

Configuring an owasp:api red team for an API-calling LLM

This sequence turns an LLM application's tool calls into a scoped red team run against the owasp:api preset. It ends with triaged findings, verified fixes and a stored configuration that someone else can rerun.

  1. Map the tools and backend APIs

    The application owner and the engineers who built the tool layer list every tool the model can call, the backend API each tool reaches, and the objects and functions each API exposes. Include the parameters the model fills in, such as account IDs, record IDs and URLs, because these are where object-level and function-level authorization checks usually fail. The step is done when the list is written down and each tool has a named owner who can answer questions about its permissions.

  2. Create test identities with granted scopes

    Engineers create two or more test users in the identity provider, each with the scopes, roles and tenant memberships that real users receive, and at least one account with no access to the sensitive objects. Keep the grants identical to production policy so a finding reflects a real gap, not a test account with unusual rights. The step is done when each identity can be used to call the application, and the owner has confirmed in writing which permissions each identity should hold.

  3. Point the target at staging

    Configure the promptfoo target to call the staging deployment of the application, including its agent or chat endpoint and the test identities' session handling. Confirm that the tools in staging connect to staging backends with test data, so probes that succeed in reading or changing records cannot touch production. The step is done when a single benign request through the target returns the expected tool call and the backend logs show it reached staging.

  4. Configure the owasp:api preset and grading

    Add the owasp:api preset to the red team configuration, covering the API Security Top 10 (2023) categories, and review which plugins it enables against your tool list. Define the grading criteria for each category in plain language, such as what counts as a leaked record or an unauthorized function call, and record the purpose statement that tells the grader what the application is allowed to do. The step is done when the configuration file is committed and a reviewer has signed off on the grading rules.

  5. Run the scan and capture raw output

    Run the red team scan from the CLI or your pipeline against staging, and save the full output, including each probe, the model response, the tool calls and the grader's verdict. Store the run identifier and the promptfoo version used, because results from different versions may not be directly comparable. The step is done when the run completes and the raw results are saved in a location the security team can read.

  6. Triage findings into tickets

    Security engineers and API owners review each failed probe, confirm whether the failure is a real authorization, SSRF or resource consumption issue, and discard false positives with a short reason. Each confirmed finding becomes a ticket that names the tool, the API endpoint, the test identity and the reproduction probe. The step is done when every failed probe has a status of confirmed, false positive or accepted risk, with an owner for each open item.

  7. Fix, retest and store the configuration

    Engineers fix the confirmed issues in the tool layer or backend API, usually by enforcing object ownership checks, function-level permissions and outbound URL allow lists on the server side rather than relying on the prompt. Rerun the same configuration against the same identities, then archive the configuration, the final report and the ticket links together in version control. The step is done when the retest shows the fixed probes passing and the archived record lets someone else reproduce the run.

Questions buyers ask before testing OWASP API risks in an LLM app

Does the promptfoo Community edition include the owasp:api preset?

The Community edition is free and includes red teaming with 10k probes per month, with community support, and the owasp:api preset is a red teaming feature, so it should be available there. Confirm the current probe limits and any preset restrictions on the promptfoo pricing page before you plan a scan schedule. A preset run uses probes from your monthly allowance, so the size of your tool surface and how often you rerun it both affect whether the free tier is enough for your team.

What drives the effort of testing an LLM app against API risks?

The main driver is the attack surface the model can reach. Effort grows with the number of tools the LLM can call, the number of user identities and roles that must be tested for object and function level authorization, and the number of backend APIs behind those tools. Each tool that accepts a URL, an identifier or a resource quota adds cases for SSRF and resource consumption. Multi-tenant data and agents that act with a service account also add work, because each permission boundary needs its own test pairs. Ask any partner to break the quote down by tool, identity and backend API.

What does the team need to provide before API security testing starts?

Testing against live customer data is rarely the right starting point, so the work usually needs a staging environment that mirrors production authorization and tool wiring. You also need test accounts for each role and tenant the model can act for, with known object identifiers that belong to each account. API documentation or an OpenAPI description of the tools and backends, plus a list of which tools are write-capable, lets testers target the right functions. Agree in advance who owns the staging environment, how credentials are issued and revoked, and which network egress is allowed for SSRF probes.

Can our own team run the owasp:api red team without outside help?

Yes, a team with engineering and security skills can run the preset itself, since promptfoo runs locally as a CLI, library or in CI/CD. The harder part is the setup that the preset cannot infer: writing a provider that calls your real agent with the right identity, defining what counts as a successful unauthorized action, and reviewing findings against your authorization model. Teams that already own the app and its API documentation often handle the scan and triage in-house, then bring in a partner for the design review of tool permissions. Decide which of those steps your team can staff before you commit to either path.

How long does an OWASP API red teaming engagement take?

Duration depends on the scope, and no fixed timeline applies across every application. The variables are the number of tools and backend APIs, the number of identities that need authorization tests, the state of the staging environment, and how many fix and retest cycles the findings require. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. Ask for a quote that lists the tools, roles and APIs in scope, the dependencies on your team, and the number of retest rounds included.

Does a passing owasp:api red team run mean we are compliant?

No. A passing run shows that the probes you configured did not produce the failures they target at the time you ran them. It does not establish that your application meets OWASP guidance in full, that a regulation is satisfied, or that an auditor will accept the result. Automated probes cover some authorization and SSRF cases well but miss business logic flaws, unusual identity flows and design weaknesses in how tools are granted. Use the output as test evidence within a broader assessment, and ask an independent auditor or certification body to judge any compliance claim.

Will DeployOpen guarantee that our API risks are closed?

DeployOpen does not offer guarantees that a system is free of vulnerabilities. Engagements run security testing, deliver a findings report with fixes and can include a retest, so you can verify whether the issues were resolved. Scope, deliverables and timelines are agreed in writing before work starts, and the findings describe what was tested and what was not. Ask any partner to define in writing what the retest covers and which tool paths remain outside the test.

How DeployOpen scopes and delivers OWASP API red teaming and evidence

DeployOpen plans promptfoo red teaming for the OWASP API Security Top 10 as a fixed-scope piece of work, agreed in writing before testing starts. The engagement covers the tool-calling application, the APIs it reaches, and the evidence the client's security and compliance teams need to review the results.

How we scope

  • Written scope names the LLM application, its tools and the backend APIs each tool can reach.
  • Scope lists which API1 and API5 authorization paths, SSRF targets and resource limits are in test.
  • Test accounts, roles and data sets are agreed up front, including which environments are permitted.

How we build

  • We configure promptfoo with the owasp:api preset against a target you control, not a shared service.
  • Custom plugins and HTTP or Python targets are built for your tool definitions and authentication flow.
  • Findings are graded and reviewed by an engineer before they reach the report, to reduce false positives.

How we hand over

  • Deliverables include the promptfoo configuration, reproducible test commands and raw result files.
  • A findings report maps each issue to its API risk ID, with evidence, severity and a suggested fix.
  • Retesting after fixes is included in the written scope, so the client can confirm each issue is closed.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainers can cover re-running the preset when tools, routes or prompts change in your application.
  • Ask your DeployOpen contact to confirm which evidence formats your auditors or assessors accept.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.