Console API
The Console API functions are typed wrappers around the Pensar Console REST API. They’re what the pensar issues, pensar pentests, pensar apps, and related CLI commands call.
Every function authenticates with the credentials from pensar login (or PENSAR_API_KEY), and operates on the selected workspace. See Pensar Console authentication. They throw Error on non-2xx responses. See Console API errors.
Functions that take an issueId accept either the issue UUID or its label, such as VULN-000123.
Pentests
scanLevel sets scan depth: priority (the server default) or full. Pass endpointIds (1–1000 endpoint UUIDs) to test specific existing endpoints. Endpoint launches run at full depth and can’t be combined with branch or priority depth. Pass knowledgeEntryIds to give agents specific knowledge entries. Resolves with { scanId, label, status: "queued", message }. See pensar pentests for details.
Issues
duplicateOf (the UUID or label of the original) is only sent with the duplicate disposition. The accepted dispositions are exported as CLOSED_DISPOSITIONS.
Fixes
Agent logs
Filter options: level (debug, info, warn, error), role (assistant, user, system, tool-call, tool-result), and limit for list calls.
Apps and endpoints
List and search responses return lean summaries. Call getApp or getEndpoint for the full record.
Knowledge
Categories (KNOWLEDGE_CATEGORIES): false_positive_pattern, technology_context, testing_history, user_note, agent_learning. Statuses (KNOWLEDGE_STATUSES): active, stale, archived.