sessions
A session is a directory under ~/.pensar/sessions/<id>/, together with the configuration for one engagement: targets, scope, credentials, headers, and safety switches. Every agent runner takes a session, writes its findings, POCs, and logs into it, and reads its configuration from it.
sessions.create
Creates the session directory and returns the session.
URLs, hosts, or IPs in scope. Unless config.scopeConstraints.allowedHosts is set, these hostnames define the in-scope hosts.
Display name. When omitted, a random name is used, or an AI-generated one if model and authConfig are provided.
Configuration for agents that run in this session. See Session config.
Prefix for the session ID, for example "ci-".
Model used to generate a session name in the background. Only used when name is omitted.
Credentials for name generation.
Returns: SessionInfo
Unique session ID.
Absolute path to the session directory.
Absolute path to findings/.
Absolute path to pocs/.
Absolute path to logs/.
The session’s targets.
The resolved configuration, including defaults such as headers and outcomeGuidance.
Session config
All fields are optional.
Scope and safety
allowedHosts overrides the in-scope hosts derived from targets. It supports wildcards such as *.example.com. With strictScope: true, requests to out-of-scope hosts or ports fail, even after redirects or newly discovered assets.
Rate limit for outbound requests to the target.
Allow destructive testing: financial mutations, database deletes and drops, and destructive API writes. When false, those operations are blocked at the tool layer.
Allow burst and volumetric testing to probe for missing rate limits. Endpoints with real-world side effects, such as email, SMS, and payments, are never looped either way.
Enumerate subdomains during attack surface discovery.
CTF-style mode: allows pivoting and flag extraction through confirmed vulnerabilities.
What counts as a successful exploit. Defaults to proving exploitability without exfiltrating data or causing harm.
Authentication credentials
Credentials agents can log in with. Agents see only credential references in their prompts; tools resolve the secrets at execution time. Pass an array to test with multiple roles.
Login username or email.
Login password.
Login page URL.
API key, for API-key auth.
Role label, such as admin or viewer, used for authorization testing.
Existing tokens to reuse instead of logging in.
The target uses Sign in with Google.
authCredentials is saved as part of the session config in session.json, in plaintext. Treat ~/.pensar/sessions/ as sensitive, and delete sessions with sessions.remove() when you no longer need them.
Free-form instructions for the login flow.
Requests
Headers sent on every in-scope request (HTTP tools, supported CLI tools, and browser navigation). When omitted, the global pensar config headers defaults are copied in at creation time. Pass {} to send no custom headers.
Agent behavior
Source code path for whitebox analysis.
Operator guidance injected into agent system prompts.
Run targeted pentests as one worker instead of one sub-agent per objective. Cheaper and faster, but less thorough.
Run a planning phase before pentest agents start executing.
Experimental. Agents break objectives down into tracked tasks.
sessions.get
Loads a session from disk. A loaded session’s config.authCredentials is present, but its credential manager isn’t rebuilt. To run authenticated agents again, create a new session with the credentials.
sessions.remove
Deletes the session directory and everything in it.
list
Yields every session in ~/.pensar/sessions/. Directories without a valid session.json are skipped.