API security for AI / ML engineers

What middleBrick covers

  • Black-box API scanning with read-only safety
  • 12 OWASP API Top 10 (2023) categories including AI security
  • LLM adversarial probes across Quick, Standard, and Deep tiers
  • OpenAPI 3.0/3.1 and Swagger 2.0 contract validation
  • Authenticated scanning with header allowlist and domain gate
  • Continuous monitoring with diff detection and webhook alerts

Risk context for AI and ML APIs

AI and ML services expose endpoints that manage models, fine-tuning jobs, embeddings, and inference calls. These surfaces often carry high-value data and credits, making them a target for enumeration, data exfiltration, and prompt manipulation. Traditional API scanners miss adversarial prompts and model-specific leakage, while intrusive tests can corrupt state or increase costs. MiddleBrick is a black-box scanner designed for these workflows, using read-only methods only and blocking unsafe targets at multiple layers.

Detection aligned to OWASP API Top 10 and AI/ML concerns

The scanner checks the 12 categories aligned to OWASP API Top 10 (2023), with specific coverage for AI/ML risks such as LLM / AI Security, Unsafe Consumption, and Data Exposure. It detects JWT misconfigurations, sensitive data in claims, PII patterns including credit card and SSN, API key formats, error leakage, SSRF in URL accepting parameters, and over-exposed internal fields. For AI workloads, it runs 18 adversarial probes across Quick, Standard, and Deep tiers to surface system prompt extraction, instruction override, DAN and roleplay jailbreaks, data exfiltration, cost exploitation, and token smuggling risks.

OpenAPI contract validation and authenticated scanning

MiddleBrick parses OpenAPI 3.0, 3.1, and Swagger 2.0 with recursive $ref resolution and cross-references spec definitions against runtime behavior. This highlights undefined security schemes, deprecated operations, missing pagination, and sensitive fields in the spec that may not be enforced. Authenticated scanning supports Bearer, API key, Basic auth, and Cookie, gated by domain verification so only domain owners can scan with credentials. Only a curated set of headers is forwarded to limit side effects.

Continuous monitoring and integration options

With Pro tier, scheduled rescans every 6 hours, daily, weekly, or monthly track score drift and findings changes. Diff detection surfaces new risks, resolved items, and score movement, while email alerts are rate-limited to one per hour per API. HMAC-SHA256 signed webhooks can notify CI/CD pipelines, auto-disabling after five consecutive failures. Integrations include a web dashboard, CLI via an npm package, GitHub Action with CI/CD gates, and an MCP server for AI coding assistants.

What the scanner does not do and compliance framing

MiddleBrick does not fix, patch, block, or remediate findings; it detects and provides remediation guidance. It does not perform active SQL injection or command injection, detect business logic vulnerabilities, or perform blind SSRF. This tool supports audit evidence for SOC 2 Type II and maps findings to PCI-DSS 4.0 and OWASP API Top 10 (2023). It helps you prepare for security reviews and aligns with security controls described in relevant frameworks, but it is not an auditor and cannot certify compliance.

Frequently Asked Questions

Can I scan AI model management endpoints with authentication?
Yes. Provide Bearer or API key credentials after domain verification. The scanner runs read-only requests and supports custom headers in the allowlist.
Does the scan trigger model training or inference costs?
No. The scanner avoids methods that modify state or trigger paid inference. It focuses on enumeration, configuration review, and adversarial prompt probes that do not execute model workloads.
How are findings mapped to compliance frameworks?
Findings map directly to PCI-DSS 4.0, SOC 2 Type II, and OWASP API Top 10 (2023). For other regulations, the output helps you prepare for audits and aligns with security controls described in those frameworks.
Can I integrate scans into my CI pipeline?
Yes. Use the GitHub Action or the CLI to fail builds when the score drops below your chosen threshold. Programmatic access is available via the API client for custom workflows.
What happens to my scan data after cancellation?
Customer data is deletable on demand and purged within 30 days of cancellation. It is never sold and is not used for model training.