All plugins

barrier-shield

Control-Barrier Function (h(x) >= 0) and Lyapunov continuous safety shield that solves a real-time Quadratic Program (QP) to smoothly dampen aggressive tool actions. Disclosure — when the owner turns it on in the plugin settings, barrier-shield lowers the batch, limit, worker and concurrency arguments of the tools listed in rewritable_tools and reduces the model's sampling temperature; both are off by default and terminal commands are never modified.

arjunbagga-xyzToolsv0.1.0Updated 3 days ago

About

Control-Barrier Function (h(x) >= 0) and Lyapunov continuous safety shield that solves a real-time Quadratic Program (QP) to smoothly dampen aggressive tool actions. Disclosure — when the owner turns it on in the plugin settings, barrier-shield lowers the batch, limit, worker and concurrency arguments of the tools listed in rewritable_tools and reduces the model's sampling temperature; both are off by default and terminal commands are never modified.

barrier-shield

Control-Barrier Function ($h(x) \ge 0$) & Lyapunov Continuous Safety Shield for Hermes Agent.

Current AI safety guardrails are binary regex brick walls: they either let a dangerous action through at 100% speed or throw a hard PermissionError that crashes the agent's reasoning loop.

Inspired by aerospace flight-envelope protection (Ames et al., Control Barrier Functions: Theory and Applications), barrier-shield defines a continuous safe state manifold $\mathcal{C} = {x \in \mathbb{R}^n : h_i(x) \ge 0}$ over cumulative API/compute spend, filesystem blast radius, concurrency load, and irreversible mutation intensity. Before any tool executes (tool_request middleware), barrier-shield solves a real-time Quadratic Program (CBF-QP):

$$u^* = \arg\min_{u \in \mathcal{U}} \frac{1}{2}|u - u_{\text{nom}}|_2^2 \quad \text{s.t.} \quad h_i(x_t + B u) - h_i(x_t) \ge -\gamma_i h_i(x_t)$$

By Nagumo's Theorem, $\mathcal{C}$ is mathematically forward-invariant: the agent never crashes into a hard error wall, and never crosses $h(x) < 0$—instead, its batch sizes, concurrency, and blast radius smoothly and tangentially decelerate along the safety boundary!

Configuration

All active argument rewriting and temperature damping behaviors are opt-in and disabled by default, configured via Hermes plugin configuration (ctx.get_config captured during registration):

  • enable_argument_rewriting (boolean, default: false): When enabled, projects resource parameters (batch_files, workers, concurrency, limit) onto safe forward-invariant bounds for tools explicitly listed in rewritable_tools. Terminal commands and financial payment amounts are never modified.
  • rewritable_tools (list of strings, default: []): Explicit allowlist of tool names whose resource parameters may be adjusted when enable_argument_rewriting is true.
  • enable_temperature_damping (boolean, default: false): When enabled, applies Lyapunov energy damping to cool sampling temperature when loop instability rises.
  • max_budget_usd (number, default: 25.0): Owner ceiling for cumulative spend in USD. Autonomous tool calls cannot raise limits beyond owner-configured ceilings.
  • max_blast_radius_files (number, default: 50.0): Owner ceiling for filesystem blast radius.
  • gamma_decay (number, default: 0.45): Class-K barrier decay rate $\gamma \in (0, 1]$.
  • State is scoped per session_id, decays exponentially toward baseline over time, and inactive/expired session states are automatically pruned to prevent unbounded memory growth on long-lived gateways.

README from the reviewed commit 88c903a; it updates when the author re-pins.

More by arjunbagga-xyz

7 plugins by arjunbagga-xyz in the catalog.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section