OpenHands is an open-source AI-driven development platform. ToolShield injects safety guidelines as a microagent that is always loaded into the agent's system prompt.
OpenHands supports microagents — specialized markdown files that enhance agents with domain-specific knowledge. ToolShield creates a user-level microagent at ~/.openhands/microagents/toolshield.md with type: repo, which means it is always active (no keyword triggers needed).
toolshield import \
--exp-file postgres-mcp.json \
--agent openhandsYou can import multiple tools — each appends to the same microagent file:
toolshield import --exp-file terminal-mcp.json --agent openhands
toolshield import --exp-file filesystem-mcp.json --agent openhandstoolshield unload --agent openhandsThis deletes the toolshield.md microagent file entirely.
| Platform | Path |
|---|---|
| All | ~/.openhands/microagents/toolshield.md |
The generated file follows the OpenHands microagent spec:
---
name: toolshield
type: repo
version: 1.0.0
agent: CodeActAgent
---
## Guidelines from Previous Experience
...You can temporarily disable the microagent without deleting it by adding to your OpenHands config.toml:
[agent]
disabled_microagents = ["toolshield"]