> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pensar.dev/apex/sdk/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/apex/_mcp/server. # SDK > AI-powered penetration testing CLI. ## Docs - [SDK Overview](https://docs.pensar.dev/apex/sdk/overview.md): Embed Apex agents in your own TypeScript and JavaScript tools with the @pensar/apex package - [SDK Quickstart](https://docs.pensar.dev/apex/sdk/quickstart.md): Run an Apex pentest from TypeScript in a few lines of code - [SDK Configuration](https://docs.pensar.dev/apex/sdk/configuration.md): Configure AI provider credentials, models, and Pensar Console authentication for the Apex SDK - [Errors and Cancellation](https://docs.pensar.dev/apex/sdk/errors-and-cancellation.md): Abort Apex agent runs and handle errors from agents and the Pensar Console API - [runPentestAgent](https://docs.pensar.dev/apex/sdk/reference/run-pentest-agent.md): Run a full blackbox or whitebox pentest: attack surface discovery followed by a swarm of targeted pentest agents - [runTargetedPentestAgent](https://docs.pensar.dev/apex/sdk/reference/run-targeted-pentest-agent.md): Run a focused pentest against one target with explicit testing objectives - [runAttackSurfaceAgent](https://docs.pensar.dev/apex/sdk/reference/run-attack-surface-agent.md): Map a target's attack surface from the outside (blackbox) or from its source code (whitebox) - [runAuthenticationAgent](https://docs.pensar.dev/apex/sdk/reference/run-authentication-agent.md): Log in to a target with session credentials and export the resulting cookies and headers - [runOffensiveSecurityAgent](https://docs.pensar.dev/apex/sdk/reference/run-offensive-security-agent.md): Run Apex's general-purpose operator agent with your own prompt, tools, and stop conditions - [runThreatModelWorkflow](https://docs.pensar.dev/apex/sdk/reference/run-threat-model-workflow.md): Generate a threat model document for a codebase - [runPatchingAgent](https://docs.pensar.dev/apex/sdk/reference/run-patching-agent.md): Fix a security vulnerability in a codebase and get a pull request title and description - [sessions](https://docs.pensar.dev/apex/sdk/reference/sessions.md): Create, load, and delete the sessions that hold Apex agent configuration and artifacts - [AgentEventBus](https://docs.pensar.dev/apex/sdk/reference/agent-event-bus.md): Subscribe to streaming text, tool calls, sub-agent lifecycle, and workflow phase events from Apex agents - [Console API](https://docs.pensar.dev/apex/sdk/reference/console-api.md): Read and manage Pensar Console pentests, issues, fixes, logs, apps, endpoints, knowledge, and domains from TypeScript