Run tests in CLI using Akto
You can run Akto testing module via CLI for local testing of agent components.
When to Use
Run Akto tests locally on any agent collection
Results from CLI are NOT saved in Akto dashboard
Best used when developers want to run tests locally before committing code
Override application host URL to localhost or different staging URL
How to Use
Prepare the following environment variables:
AKTO_API_KEY- Go to My accounts > Settings > Integrations > Akto API > Generate tokenAKTO_DASHBOARD_URL- URL of your dashboardTEST_IDS- Space-separated list of test IDs to run (e.g.,PROMPT_INJECTION MCP_AUTH_BYPASS) orALLfor all testsAPI_COLLECTION_NAME- Collection name to test (e.g., agent_collection)API_COLLECTION_ID- Collection ID (integer). Only one ofAPI_COLLECTION_NAMEorAPI_COLLECTION_IDis requiredTEST_APIS- Space-separated list of components to test. If absent, all components are selectedOVERRIDE_APP_URL- Change the application host for testingOUTPUT_LEVEL- Output level:NONE- No output fileSUMMARY- [Default] Tests executed and list of vulnerable componentsDETAILED- Summary plus test descriptions and impactDEBUG- Detailed output with original and attempt request/response
Example CLI:
Results
Short summary (Component, Vulnerability, Severity) printed on command line
File
output.txtcontains test details based on output levelIf you see version mismatch error, match release version of dashboard vs testing-cli
Limitations
Results are not saved in Akto dashboard
Tests which use context will be skipped
Last updated