runOffensiveSecurityAgent
Runs the general-purpose offensive security agent with a custom prompt and tools.Import
Function Signature
Parameters
Configuration for the offensive security agent.
Return Value
AI SDK stream result containing:
text: Generated text streamtoolCalls: Invoked tool callstoolResults: Tool execution resultsfinishReason: Why the agent stoppedusage: Token usage statistics
Example Usage
Basic Agent Execution
Custom Tools
Provide custom tools to the agent:Custom System Prompt
Provide custom guidance:Processing Stream Results
Access detailed stream data:When to Use This API
UserunOffensiveSecurityAgent when you need:
Custom agent behavior
Custom agent behavior
Define specialized testing workflows not covered by built-in agents.
Custom tools
Custom tools
Integrate your own security tools or APIs with the agent.
Fine-grained control
Fine-grained control
Full control over system prompts, tools, and execution flow.
Research and experimentation
Research and experimentation
Test new attack techniques or analysis approaches.
Limitations
Related
OffensiveSecurityAgent Class
Base agent class documentation
Pentest Agent
Specialized pentest agent
Agents Concept
Understanding the agent architecture
Sessions
Managing agent sessions

