NVIDIA / NVIDIA/NeMo-Agent-Toolkit

Feature request: official HOL Guard security middleware example

Open
#2,176 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
762
Avg merge
21h 28m
Merged PRs (30d)
27

Description

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request?

Medium

Please provide a clear description of the problem this feature solves

NeMo Agent Toolkit now has first-class function middleware that can wrap individual functions or whole function groups, preprocess inputs, and short-circuit execution. That is a strong fit for an explicit runtime-security example, but there is currently no official example showing users how to put HOL Guard itself on that pre-execution boundary.

HOL Guard is an open-source, local-first runtime security layer for AI agents and tools: https://github.com/hashgraph-online/hol-guard. It can allow safe actions, block risky ones, or pause ambiguous actions for review. An official NAT example would remove ambiguous integration choices and, importantly, show the fail-closed ordering needed to ensure a blocked action never reaches the downstream function.

Describe your ideal solution

Add one small official HOL Guard middleware/example to the NeMo Agent Toolkit docs/examples, using the existing middleware surface rather than adding a generic new hook.

The accepted example should directly install/import and invoke hol-guard before call_next, with these observable semantics:

  • allow -> invoke the wrapped NAT function exactly once.
  • deny -> return/raise the documented blocked result without invoking the wrapped function.
  • review -> pause/return before call_next; only an explicitly approved continuation may execute later.
  • Guard error or timeout -> fail closed for the protected action, with zero downstream execution.
  • Demonstrate application to both an individual function and, if useful, a function group.
  • Include focused tests with a fake/stub Guard decision source proving blocked paths execute the wrapped function zero times.
  • Keep HOL Guard local-first; Cloud should not be required for the example.

A DynamicFunctionMiddleware-style example looks like the smallest landing surface because NAT already supports preprocessing and short-circuiting there. If the project prefers a provider-managed third-party plugin/example package instead, I am happy to follow that placement, as long as the official artifact itself names, installs, and invokes HOL Guard on the pre-execution path.

Relevant NAT docs: https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/build-workflows/advanced/middleware.md
HOL Guard: https://github.com/hashgraph-online/hol-guard

Additional context

This is intentionally issue-first. I have not opened an implementation PR because the current contribution guide asks contributors proposing a new feature to discuss design and implementation with the team before coding.

Code of Conduct

I agree to follow this project's Code of Conduct, and I searched the repository for existing HOL Guard / hol-guard issues and pull requests before filing this request.

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 docs/source/build-workflows/advanced/middleware.md and inspect the existing DynamicFunctionMiddleware surface. Confirm the example's placement and HOL Guard integration path with maintainers before coding. Done means the official local-first example and focused tests demonstrate allow, deny, review, and fail-closed guard behavior without downstream execution on blocked paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, documentation, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.