OpenHands / OpenHands/software-agent-sdk

Example proposal: HOL Guard via SecurityAnalyzerBase

Open
#4,593 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement proposal ready-for-dev security
Dominant language
Python
Stars
1.1k
Forks
539
Avg merge
1d 19h
Merged PRs (30d)
137

Description

Would you be open to a small official standalone-SDK example that plugs HOL Guard directly into the existing SecurityAnalyzerBase / confirmation path?

HOL Guard is a local-first security layer for AI agents (pip install hol-guard): https://github.com/hashgraph-online/hol-guard

The SDK already has the right extension point: SecurityAnalyzerBase.security_risk(ActionEvent), Conversation.set_security_analyzer(...), ConfirmRisky, and the existing WAITING_FOR_CONFIRMATION / reject_pending_actions(...) flow. The current LLM analyzer example in examples/01_standalone_sdk/16_llm_security_analyzer.py looks like a natural model for the placement.

Desired Behavior

Provide one official standalone SDK example that installs and invokes HOL Guard itself through a small SecurityAnalyzerBase adapter, while leaving the SDK's core security interfaces generic.

The example would pass the relevant ActionEvent tool/command context to HOL Guard's runtime policy evaluation path rather than duplicating Guard rules in OpenHands. Safe decisions stay on the normal low-risk path. Guard review/block decisions (and evaluation failures) enter the existing high-risk/confirmation flow. An explicit Guard block must not silently execute; the example should reject the pending action rather than bypass the Guard decision.

The integration should remain optional and local-first, with a short install note and link to HOL Guard. No new public SDK API or HOL Guard-specific core branch is needed.

Acceptance Criteria
  • An example under examples/01_standalone_sdk/ installs and invokes the hol-guard package through a SecurityAnalyzerBase adapter.
  • The example reuses Conversation.set_security_analyzer(...), the existing confirmation policy, and pending-action rejection flow without adding HOL Guard-specific SDK core behavior.
  • Safe HOL Guard decisions map to the normal low-risk path; review/block/error paths cannot silently execute the action.
  • The example documents the optional hol-guard install step and links to the HOL Guard project.
  • The repository's example-level validation/tests for the new example pass.

This seems consistent with the contribution guidance to prefer reusable interfaces over client-specific core code: the existing security-analyzer seam stays generic, while the example demonstrates a concrete third-party security backend.

If this landing surface makes sense, I can follow up with the smallest fork-first PR limited to the example/docs/tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/01_standalone_sdk/16_llm_security_analyzer.py and trace SecurityAnalyzerBase.security_risk, Conversation.set_security_analyzer(...), ConfirmRisky, and the WAITING_FOR_CONFIRMATION/reject_pending_actions(...) flow. Add the optional HOL Guard adapter and install note in the new example, then run the repository's example-level validation/tests; done means safe decisions remain low-risk and review, block, and error decisions cannot execute silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.