APIsec for LLM agent tool endpoints
What middleBrick covers
- Black-box scanning for LLM tool endpoint vulnerabilities
- Read-only methods with no code access or SDK dependencies
- 18 LLM adversarial probes across Quick, Standard, and Deep tiers
- OpenAPI 3.0/3.1 and Swagger 2.0 parsing with $ref resolution
- Authenticated scanning with strict header allowlist
- Continuous monitoring and diff detection for score trends
How APIsec evaluates LLM agent tool endpoints
LLM agent workflows often expose tool endpoints that accept dynamic inputs such as queries, commands, or code snippets. These endpoints can become indirect execution channels if inputs are not strictly constrained. APIsec treats tool endpoints as API operations and applies the same black-box methodology used for any other resource.
The scanner submits a focused set of LLM adversarial probes designed to test for prompt injection, jailbreak attempts, data exfiltration, and token manipulation. These probes operate at three depth tiers—Quick, Standard, and Deep—covering techniques such as roleplay jailbreaks, instruction override, base64 and ROT13 encoding bypass, translation-embedded injection, few-shot poisoning, and multi-turn manipulation.
Because the scan is read-only, it does not execute code or alter tool behavior. It measures observable responses such as refusal patterns, output leakage, error handling, and indirect prompt injection success indicators, while sensitive endpoints, localhost, and cloud metadata addresses are blocked at multiple layers.
Coverage of OWASP API Top 10 and related risks
APIsec maps findings to OWASP API Top 10 (2023), focusing on risks commonly present in agent tool implementations. Detection categories relevant to tool endpoints include Input Validation, SSRF, Data Exposure, and Unsafe Consumption.
- Input Validation checks for CORS wildcard usage, dangerous HTTP methods, and debug endpoints that could aid in probing tool interfaces.
- SSRF detection targets URL-accepting parameters and body fields, including active probes for internal IP bypass and private network reachability.
- Data Exposure searches for PII patterns such as emails and context-aware SSNs, as well as API key formats that may appear in tool outputs or logs.
- Unsafe Consumption surfaces excessive third-party URLs and broad webhook callback surfaces that expand the attack surface for agent tools.
Authentication, authorization, and scope boundaries
Authenticated scanning is required to accurately assess tool endpoints that rely on tokens or session cookies. Supported methods include Bearer tokens, API keys, Basic auth, and Cookie-based sessions. Domain verification is enforced through DNS TXT records or an HTTP well-known file to ensure that only the domain owner can scan with credentials.
When credentials are provided, the scanner forwards only a restricted allowlist of headers—Authorization, X-API-Key, Cookie, and X-Custom-*—to minimize side effects. This controlled approach helps evaluate authorization logic, such as over-permissive roles or missing ownership checks, without disrupting downstream services used by the agent.
OpenAPI analysis and spec-to-runtime alignment
If an OpenAPI specification is available, APIsec parses OpenAPI 3.0, 3.1, and Swagger 2.0 documents with recursive $ref resolution. The engine cross-references defined security schemes, parameters, and response models against observed runtime behavior.
Findings include undefined security schemes, unexpected sensitive fields in responses, deprecated operations, and missing pagination controls. For tool endpoints, this analysis highlights deviations such as missing input constraints, overly permissive request bodies, and inconsistent error handling that may facilitate prompt injection or data leakage.
Limitations and responsible expectations
APIsec does not execute intrusive payloads such as SQL injection or command injection, as those tests fall outside its non-intrusive scope. It also cannot detect business logic vulnerabilities that require deep domain understanding, nor does it perform blind SSRF testing that depends on out-of-band infrastructure.
The scanner reports findings and provides remediation guidance, but it does not fix, patch, or block issues. High-stakes audit requirements should involve human review alongside automated scanning to address contextual risks in agent tool designs.