Testing tool disclosure and excessive agency with promptfoo

Check whether your assistant reveals the tools it can call and whether it claims actions it cannot take, using promptfoo's tool-discovery and excessive-agency plugins.

On this page

Testing promptfoo tool disclosure and excessive agency before an agent goes live

Before an assistant that calls tools, APIs or functions goes live, you need evidence that it does not reveal its tool inventory to users and does not claim actions it cannot take. promptfoo answers both with two red teaming plugins: the tool-discovery plugin and the excessive-agency plugin. The tool-discovery plugin tests whether the AI system reveals the tools, functions or API calls it has access to. The excessive-agency plugin tests whether the model claims to perform actions beyond its capabilities, such as saying it has sent an email, issued a refund or changed a record when the connected tools cannot do that. Both checks send adversarial prompts to the system under test and grade the replies, so they fit naturally into a pre-launch review.

promptfoo runs locally: evals execute on your machine and talk directly with the model or application you point it at, according to the promptfoo documentation. That matters for an agent that holds internal API definitions, because the tool names and parameters you are testing for do not have to pass through a hosted service of promptfoo's to be exercised. Confirm this against your own setup, including any model provider that the tests call, since that provider will still receive the prompts and replies. Treat the results as red teaming evidence, not a guarantee. A pass means the probes in that run did not extract the tool list or elicit a false action claim; it does not prove the agent is safe against every phrasing, and a failure usually points to a prompt, system message or tool-description change to make before retesting.

Plan the test around the tools the agent really holds. List each function, API route and permission the assistant can call, then check that the system prompt, tool descriptions and error messages do not hand over more than a user needs. Decide who signs off on a failing result and what counts as a blocking finding for your release. Record the promptfoo version, the model and the configuration used so the run can be repeated after each fix. Pair these checks with the authorization tests that cover what an agent can do once it is asked, since disclosure and overreach are two halves of the same review.

How a tool disclosure test flows through promptfoo

The test starts in the red team configuration, where the tool-discovery and excessive-agency plugins are selected for the target. promptfoo generates probes and sends them from the local process to the target application, which runs the assistant with its tools. The grader inspects each response for disclosed tool names, functions or API calls, and for claimed actions the assistant cannot take. Findings then go into a report that drives fixes and a retest. The trust boundary sits between the local promptfoo process and the target application, so check what crosses it.

The tool disclosure test path, with the boundary between the local process and the target.

Which plugin fits which assistant

When the system prompt names the tools, the tool list is already part of the instructions the assistant holds, so the first question is whether it repeats that list to a user who asks. Start with the tool-discovery plugin, because its purpose is to test whether the system reveals the tools, functions or API calls it can access. Run it against the deployed configuration, including any wrapper that adds or hides text, since a prompt copied into a notebook can differ from production.

  • Run first: the tool-discovery plugin, because the likely failure is the assistant reciting function names, parameters or endpoints.
  • Pass looks like: the assistant does not list, quote or describe internal tools, functions or API calls when probed for them.
  • Run second: the excessive-agency plugin, to check that the assistant does not claim to perform actions beyond its capabilities.
  • Test target: use the production prompt and middleware, not a development copy.
  • Compare phrasings: note whether answers change when a question is framed as debugging or developer help.

Confirm in the plugin documentation which probe styles it uses before you describe the coverage to reviewers.

Configuration choices for the two plugins

This table compares the configuration decisions that shape a tool-discovery and excessive-agency scan, with the situations where each option fits. Read each row as a choice to make before the first run, and confirm exact configuration keys in the plugin documentation before you write any config.

DecisionOptionWhen it fits
Plugin selectionRun tool-discovery onlyYour main concern is whether the assistant lists its functions, API endpoints or internal tool names when asked
Plugin selectionRun excessive-agency onlyYour main concern is whether the assistant claims to send email, change records or execute actions it cannot perform
Plugin selectionRun both togetherThe assistant has real tools and users may ask about them, so disclosure and overclaiming should be tested in one pass
Scan sizeSmall scan on the Community editionEarly tuning of the purpose statement and target description, where the 10k probes per month allowance is enough for repeated short runs
Scan sizeLarger scan for a release gateYou need stable pass rates across many probes, and you should budget the monthly probe count before scheduling runs in CI
Purpose statementDescribe the assistant's real tools and limitsYou want the grader to know which tools exist, so it can judge whether a disclosure is harmful or merely a normal capability description
Purpose statementKeep it genericUse only for a first look, since vague purpose text can produce grading that misses overclaims about specific tools
Target descriptionList the tools the assistant can call and those it cannotExcessive-agency checks depend on knowing the boundary, so an accurate list of forbidden actions makes overclaiming findings easier to read
Combining with other pluginsAdd prompt extraction or system prompt probesTool names often sit in system prompts, so pairing disclosure tests with prompt leakage tests shows the full exposure
Combining with other pluginsKeep this scan separate from authorization testsKeep results readable when you are also testing whether a user can reach functions above their role
Grading expectationsSet the pass condition as no tool details disclosed beyond approved namesChoose this when internal function names, parameters or endpoints count as sensitive in your environment
Grading expectationsSet the pass condition as the assistant states limits accuratelyChoose this when the assistant is allowed to describe public capabilities but must not promise actions it cannot take

Setting up a tool disclosure and excessive agency scan

This sequence takes a team from a clean promptfoo install to a reproducible list of tool disclosure and excessive agency findings, each traced to the exact exchange that produced it. The result is evidence the team can act on and retest after fixes.

  1. Install promptfoo on a supported Node.js runtime

    The engineer running the scan installs promptfoo from npm on a workstation or CI runner. The current npm release requires Node.js 22.22.0 or newer, so check the runtime version first with node --version and upgrade it if needed. Confirm the install by running promptfoo --version and recording the version in the scan notes, so the findings can be reproduced later with the same tool.

  2. Write down the target's actual tool inventory

    The application owner lists every tool, function and API call the assistant can invoke in production, including the parameters each one accepts and the permissions it runs under. This list is the baseline for the whole exercise. Write it in plain language before touching the config, because a scan configured from memory or from the product brief often misses tools that were added later.

  3. Describe the target and its tools in the red team config

    The engineer creates a red team configuration that names the application, its purpose and its user roles, and describes each tool from the inventory in the redteam section so the generated probes target real capabilities. The configuration should point at a non-production instance with test identities and no live customer data. The config file is complete when a dry run lists the expected purpose and tool descriptions without errors.

  4. Enable the tool discovery and excessive agency plugins

    The engineer adds the tool-discovery plugin, which tests whether the assistant reveals the tools, functions or API calls it can reach, and the excessive-agency plugin, which tests whether it claims actions beyond its capabilities. Keep other plugins out of this first run so that any failure can be traced to these two checks. The step is done when the config validates and the planned probe count is visible before the scan starts.

  5. Check the tool list against what the scan assumed

    Before the scan is trusted, the engineer compares the tool list in the config with the inventory from the first step and with the target's own tool definitions. Any tool present in production but absent from the config is a gap, and any tool in the config that the application no longer exposes will produce false findings. The check closes when both lists match and the owner has signed off on the differences, if any.

  6. Run the scan against the non-production instance

    The engineer runs the red team scan from the CLI against the non-production target, using the same promptfoo version recorded earlier. The scan sends its probes directly from the engineer's machine or runner to the model and application under test, so confirm that the endpoint and model credentials are approved for that data path. The run is complete when the results file or web view lists a pass or fail result for each probe.

  7. Review each failing probe with its trace

    For every failing probe, the reviewer opens the prompt, the assistant's reply and the trace of any tool calls, then records whether the assistant disclosed a tool or claimed an action it could not perform. Classify each finding by the tool involved and the user role under test, and note whether the failure is a disclosure, a false capability claim or a grading error. The review is finished when every failure has a written classification and a trace reference.

  8. Reproduce each finding on a second run

    The engineer reruns the scan, or reruns the specific failing probes, against the same instance and compares the results with the first run. A finding counts only if it fails again with a comparable trace, because model output varies between calls. Findings that do not reproduce are recorded as unconfirmed and are not sent to the application team as confirmed defects until the cause is understood.

Security and operational risks when testing tool access

Testing whether an assistant reveals its tools or claims actions it cannot take means sending it probes that touch real systems, real data and real credentials. The cards below cover the risks that most often surprise teams, from side effects in production to findings that themselves become a map of the tool inventory.

Probes that trigger real side effects

An excessive-agency probe asks the assistant to do something it may not be permitted to do, and a model that agrees to act may call a live tool. Run the first scans against a staging copy of each tool with write actions stubbed or logged, and confirm that every tool the assistant can reach has a test mode. Keep a list of which tools are excluded from scanning and why.

Excessive agency plugin

Schemas and responses sent to a hosted model

To judge whether an assistant leaks its tool list, the test harness and the grader may need to see tool schemas, parameter names and sample responses. If the model under test or the grading model is hosted, that material leaves your infrastructure. Confirm which model provider handles each step, which fields are included, and whether your data terms allow it before the first run.

promptfoo introduction

Findings that expose the tool inventory

A report listing every tool the assistant revealed is useful to a tester and equally useful to an attacker who gets a copy. Treat scan output, traces and failed-case transcripts as sensitive. Restrict who can read them, set a retention period agreed with your security team, and redact internal endpoint names and parameter details before sharing results outside the team.

Test credentials with broader rights

Testers often run scans with an administrator or shared service account because it avoids access errors. That makes the test more dangerous than production and can produce findings that do not reflect what a real user could do. Use a dedicated test identity with the same role as the users the assistant serves, and ask the team to confirm that role mapping in writing before scanning.

False positives from general descriptions

A model may describe its capabilities in general terms, such as saying it can search a knowledge base or send a message, without any tool being called. A grader can read that as disclosure or as a false claim of action. Review failed cases against the actual tool configuration and traces before filing a finding, and record which cases were judged to be wording rather than access.

Retesting after prompt and tool changes

A pass on one prompt version says little after the system prompt changes, a tool is added, or a tool's description is reworded, because the model's behavior can shift with any of these. Plan a rerun as part of each change to the assistant's instructions or tool set, and keep the scan configuration under version control so results can be compared across releases.

Questions teams ask before testing tool disclosure and excessive agency

What drives the effort of testing tool disclosure and excessive agency?

The effort scales with how many tools the assistant can call, how many of those calls have side effects, how many environments the tests must cover, and how many test identities with different permissions are needed. An assistant with a handful of read-only functions is a small job. An agent that can send email, change records or call payment or ticketing APIs needs more test cases, more sandbox setup and more careful review of each action it claims to take. Ask for the tool inventory, the side effects of each tool, and the environments available for testing before agreeing a scope in writing.

Can our own team run the tool-discovery and excessive-agency plugins?

Yes, in principle. The tool-discovery plugin tests whether the system reveals the tools, functions or API calls it can access, and the excessive-agency plugin tests whether the model claims to perform actions beyond its capabilities. Both are plugins in promptfoo's open-source red teaming, which is MIT licensed and runs locally. Your team needs to write the target configuration, decide which claims count as failures, and interpret results against your own tool list. Teams without a security or AI engineer who can judge whether a reply is a disclosure or a harmless description often ask for a review of their results.

How long does a first scan and review take?

No duration is fixed for this work, so the answer depends on scope. A first scan is quick to run once the target is connected. The time goes into connecting the assistant to promptfoo, building test identities, reviewing flagged replies, confirming which findings are real and retesting after fixes. Ask any partner to state in the written scope how many tools and environments are covered, how many review rounds are included and what the retest covers. DeployOpen agrees timelines in writing for each fixed-scope engagement.

What access and documentation does the work need?

Plan to provide a test endpoint for the assistant, a list of its tools and their parameters, the system prompt or policy that governs tool use, and at least two test identities with different permissions. Access to the sandbox or staging environment matters more than production access. Where tools change state, ask for mock or sandbox backends so that testing does not create real records. Document which tools are meant to be visible to users and which are internal, because that boundary is what the tests check.

Do we need promptfoo Enterprise to run these plugins?

No. The tool-discovery and excessive-agency plugins run in the open-source promptfoo tool. The promptfoo Community edition is free and includes red teaming with 10k probes per month, with community support. Enterprise adds team sharing, teams-based access control and SSO, custom roles and permissions, continuous monitoring, a centralized guardrail dashboard, remediation recommendations and priority support with SLAs, at custom pricing. Those features matter for multi-team rollouts, but they are not required to run these two plugins.

Where do the test results go, and who keeps them?

By default, promptfoo runs locally on your machine and talks directly with the model, so results stay where you run the scan. The self-hosted promptfoo app stores data in a local SQLite database that cannot be shared across replicas and has no built-in authentication or SSO, and the project does not recommend it for production use. If several teams need shared results, ask whether the Enterprise or On-Premise option fits, or plan where reports will be stored and who can read them.

Will the work produce evidence for an audit or certification?

The work produces test results and findings. It does not produce an audit report, attestation or certification. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue the assessment outcome. Ask for a written list of what each finding shows, which tool and test identity it involved, and how it was retested, so your compliance team can decide how to use it.

Turning excessive agency findings into fixes and a retest

Start triage by splitting the findings into two groups, because they need different fixes. The first group is tool-name disclosure: the assistant names the functions, API calls or internal tools it can reach when a tool-discovery probe asks. The second group is claimed actions: the assistant says it has sent an email, changed a record or booked something when no such tool ran, or when the tool it has does not allow that action. Disclosure is usually a prompt and configuration problem. Claimed actions are a trust problem, because a user may act on a result that never happened. Record each finding with the probe, the transcript and the tool calls the trace shows, so the team can tell which group a failure belongs to.

Choose the fix layer for each group with care. A system prompt instruction telling the model not to reveal tools or not to claim actions can reduce failures, but it is the weakest control, since a new phrasing of the probe can still get past it. Tightening the tool schema helps when the descriptions expose internal names, parameters or endpoints that users have no need to see. The permission layer is the reliable control: the function-calling code or the backing service should refuse any action the user's role does not allow, and the application should report the real outcome of each tool call back to the model and the user. Where a fix sits in the permission layer, the test should confirm that the refusal happens in the tool itself, not only in the wording of the reply.

Rerun the same probes after each change, with the same plugin configuration, target and grading, so the before and after results are comparable. Keep the original failing cases in the suite as regression tests. Confirm the retest covers the permission layer by checking tool calls in the trace, not only the text of the answer. Remediation guidance, retest sequencing and who owns each fix should be written into the scope before testing starts, including whether DeployOpen or your own engineers make the changes and how many retest rounds are included. Confirm those terms with your team before the engagement begins.

How DeployOpen scopes, tests and supports tool disclosure testing

DeployOpen plans and runs promptfoo tool-discovery and excessive-agency testing inside the client's own infrastructure, so the assistant under test, its tool definitions and the results stay under the client's control. Work follows a written scope, a documented test build and a handover the client's security and engineering teams can rerun.

How we scope

  • Inventory every tool, function and API call the assistant can reach, with the owner of each permission.
  • Agree which disclosure and overclaiming behaviours count as failures, and how the graders will judge them.
  • Set the written scope, deliverables and timeline before any testing starts, since most engagements are fixed-scope.

How we build

  • Configure promptfoo in the client's environment with the tool-discovery and excessive-agency plugins against the real target.
  • Write test identities and tool-list fixtures so that results can be repeated across runs and model versions.
  • Review each finding against the tool definitions to separate true disclosure from harmless general descriptions.

How we hand over

  • Deliver a findings report that shows the prompt, the response, the claimed action and the tool permission involved.
  • Document the fixes, such as tool-list hiding, system prompt changes and refusal logic, with the owner of each change.
  • Provide a retest run and a runbook so the client's team can repeat the tests in its own pipelines.

How we support

  • Offer ongoing support and continuous testing as a retainer when assistants gain new tools or model versions.
  • Re-run the tool-discovery and excessive-agency checks after each release that changes tools or permissions.
  • Confirm with your own team which environments, data and logs the tests may touch before support begins.

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.