Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Hardening AI Agent Tool Access in GeoMart

Description and use

Hardening AI agent tool access in GeoMart: fixing vulnerabilities, adding Cloudflare Turnstile, and correcting the database migration.

Problem

AI agents could submit quotes without human approval by exploiting insecure API endpoints and insufficient client‑side checks.

Outcome

After hardening, all automated bypass attempts failed; only genuine human interactions can submit quotes. The database now correctly records approved quotes.

Workflow

  • 1. Run Antigravity on the repo to identify vulnerabilities.
  • 2. Escape all agent‑supplied strings before inserting into the DOM.
  • 3. Add an isTrusted check to the submit button click handler.
  • 4. Remove insecure Origin and session cookie checks.
  • 5. Integrate Cloudflare Turnstile on the client and verify the token server‑side using a Worker secret.
  • 6. Apply the missing database migration for quotes.
  • 7. Retest with Antigravity, including a Node.js fetch that sets Origin to the site domain.
  • 8. Verify that all bypass attempts now return 403 or 500 as appropriate.

Evidence

Antigravity's first pass found that agent-supplied text, the quote reasoning, the product IDs in the comparison tray, was going straight into the page via unescaped innerHTML.

Source

I added Cloudflare Turnstile, verified server-side against a secret stored only in a Worker secret, never committed, never in the client bundle.

Source

  • Record date: 2026-09-06T00:08:01.526Z