AI Security Session
Overview
Use the /session API to run interactive, manual security testing with a real headless browser. This is ideal for BOLA/IDOR checks, auth flows, and targeted exploration that automated scans miss.
Workflow
- Check API health:
curl -s http://localhost:8080/health. If not running, ask to start./scanner.sh start. - Bootstrap context from existing scans. If a scan ID is provided, fetch it with
GET /scans/{id}andGET /scans/{id}/result. Otherwise, look for the latest completed scan for the target usingGET /scans?limit=10&target=.... If no completed scan exists, ask permission before running a new scan. Do not poll after submission; return scan ID and UI link, then stop. - Start a session:
POST /session/startwith a full target URL. Keep the returnedsession_id. - Explore the app with
/session/{id}/actionand capture screenshots if needed. - Use separate
usercontexts for multi‑user testing (BOLA/IDOR). - Inspect
/session/{id}for discovered endpoints and IDs. - Test endpoints with
/session/{id}/test-endpointusing different users. - End the session with
DELETE /session/{id}.
Actions
Supported action values for POST /session/{id}/action:
navigatewithdata.urlclickwithdata.selectorfillwithdata.selector,data.valuesubmitwith optionaldata.selectorwaitwith optionaldata.selectorordata.timeoutextractwith optionaldata.selectoranddata.attributeregisterwithdata.email,data.password, optionaldata.extra_fieldsloginwithdata.email,data.password
Scope Rules
Same‑origin is enforced by default to prevent SSRF. Cross‑origin static assets are allowed so modern apps still render. For cross‑origin navigation or endpoint tests, you must explicitly set allow_out_of_scope: true.
BOLA/IDOR Pattern
- Register or login as
user1and create or view a resource. - Capture a resource ID from network traffic or the API response.
- Login as
user2in a separate context. - Call
/session/{id}/test-endpointwithas_user: "user2"using theuser1resource ID.
Scan Context Hints When a scan is available, extract and use:
result.discovery.browser_api_endpointsfor candidate APIs to validate manually.result.discovery.browser_crawlfor known page URLs to navigate.result.discovery.tech.itemsto tailor testing approach.- High/critical findings for reproduction and evidence gathering.
References
See skills/ai-security-session/references/api.md for endpoint schemas and example payloads.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.