|
|
1 년 전 | |
|---|---|---|
| .. | ||
| invariant | 1 년 전 | |
| README.md | 1 년 전 | |
| __init__.py | 1 년 전 | |
| analyzer.py | 1 년 전 | |
| options.py | 1 년 전 | |
Given the impressive capabilities of OpenHands and similar coding agents, ensuring robust security measures is essential to prevent unintended actions or security breaches. The SecurityAnalyzer framework provides a structured approach to monitor and analyze agent actions for potential security risks.
To enable this feature:
From config.toml
[security]
# Enable confirmation mode
confirmation_mode = true
# The security analyzer to use
security_analyzer = "your-security-analyzer"
(to disable) remove the lines from config.toml
The SecurityAnalyzer class (analyzer.py) is an abstract base class designed to listen to an event stream and analyze actions for security risks and eventually act before the action is executed. Below is a detailed explanation of its components and methods:
EventStream that the analyzer will listen to for events.Action, it evaluates its security risk and acts upon it.In conclusion, a concrete security analyzer should evaluate the risk of each event and act accordingly (e.g. auto-confirm, send Slack message, etc).
For customization and decoupling from the OpenHands core logic, the security analyzer can define its own API endpoints that can then be accessed from the frontend. These API endpoints need to be secured (do not allow more capabilities than the core logic provides).
/api/security/{path:path} to manage settings,It uses the Invariant Analyzer to analyze traces and detect potential issues with OpenHands's workflow. It uses confirmation mode to ask for user confirmation on potentially risky actions.
This allows the agent to run autonomously without fear that it will inadvertently compromise security or perform unintended actions that could be harmful.
Features: