Skip to main content
Back to blog
Building in Public5 min read

How Our AI Security Agent Secured 34 API Endpoints in One Sprint

M
Moshe Beeri, Founder
/
securitycso-agentapi-securitycyborgenic-organizationbuilding-in-publicautonomous-security

How Our AI Security Agent Secured 34 API Endpoints in One Sprint

We run a cyborgenic organization — 11 AI agents operating 24/7 as full team members. One of them is the CSO (Chief Security Officer) agent, responsible for continuous security monitoring, vulnerability scanning, and audit compliance.

This week, the CSO agent ran an autonomous API authentication audit. The result: 34 GET endpoints across the platform now require proper authentication. Here is what happened, what it found, and what it means for autonomous security operations.

The Audit

The CSO agent scanned all 704 Python source files in our conductor service — the core API backend for Agent.ceo. The goal: find every HTTP endpoint that accepts requests without verifying the caller's identity.

This is not a theoretical exercise. Unauthenticated endpoints are one of the most common API security failures. OWASP ranks broken authentication in its top 10 every year. In a multi-tenant SaaS platform, an unauthenticated GET can leak data across organization boundaries.

The agent didn't run a scanner and file tickets. It found the endpoints, wrote the fixes, added regression tests, and opened pull requests — all in one sprint cycle.

What It Found

Across 6 modules, the CSO agent identified 11 GET endpoints in a single pass that lacked authentication middleware:

  • Organization settings — org configuration data accessible without auth
  • Knowledge base — KB metadata and search endpoints open to anonymous requests
  • MFA policy — multi-factor authentication configuration visible without credentials
  • Organization onboarding — onboarding state data unprotected
  • Extensions — integration configuration endpoints exposed
  • Orchestration — workflow status endpoints lacking auth checks

Combined with fixes from earlier in the audit cycle, the total reached 34 GET endpoints secured across the codebase.

Each fix followed the same pattern: add the authentication middleware, verify the caller's organization scope, and write a regression test that confirms unauthenticated requests return 401.

How Autonomous Security Audits Work

Traditional security audits are periodic. A team schedules a pentest, an auditor spends two weeks on the codebase, delivers a report, and the engineering team spends the next quarter remediating findings.

The CSO agent operates continuously. Every new commit triggers a review. Every new module gets scanned. The feedback loop between "vulnerability found" and "fix shipped" is measured in minutes, not months.

The audit cycle this sprint:

  1. Scan — static analysis of all route definitions across 704 files
  2. Classify — rank findings by severity (HIGH: cross-tenant data leakage, MEDIUM: missing auth, LOW: validation gaps)
  3. Fix — write the patch, add the auth middleware, scope to org
  4. Test — add regression tests, run the full suite
  5. Review — CTO reviews and approves the fix
  6. Ship — merge to main, deploy

The agent completed all 6 steps for each finding without human intervention beyond the CTO review gate. The review gate is intentional — we don't auto-merge security fixes, because false positives in auth middleware can lock out legitimate users.

The Full Audit: 10+ Vulnerabilities Resolved

The endpoint audit was one part of a broader security sprint. The CSO agent also found and fixed:

  • 1 HIGH — Cross-tenant SSE (server-sent events) topic injection that could leak real-time data between organizations
  • 5 MEDIUM — SAML XML signature validation, OAuth PKCE enforcement, SSRF hardening on cloud storage ingestion, MFA bypass edge case, credential ACL enforcement
  • 4 LOW — Firebase JWT validation tightening across session handling, claim verification, token refresh, and audience validation

Every fix includes regression tests. The full test suite passes at 4,048 tests.

Why This Matters

The security agent doesn't replace human security expertise. It extends it. The patterns it catches — missing auth middleware, unscoped queries, unvalidated input — are exactly the patterns that slip through code review when a team is shipping fast.

A human security engineer reviewing 704 files would take days. The agent completed the scan in one session. More importantly, it will scan again on the next commit, and the next, and every commit after that. The cost of continuous coverage is the cost of running the agent — roughly $5/day in compute and API calls.

This is the operational model we are building toward: AI agents that handle the systematic, exhaustive, never-miss-a-file work, while humans focus on architecture, threat modeling, and judgment calls that require context beyond what any single audit can provide.

Try It

The security audit patterns we use are built into Agent.ceo's agent infrastructure. If you are running AI agents in production and want continuous security coverage — not quarterly pentests — we would like to show you how.

agent.ceo

Related articles