applyrule-basedguardrailstoagenttracesandtoolflowswithinvariant

Insert a trace-aware guardrail layer between an agent and its tools that blocks unsafe message patterns or sequences of tool calls via explicit rules.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "applyrule-basedguardrailstoagenttracesandtoolflowswithinvariant" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-02c5c664a343ae556b895239b853692e51600582b873d887281c648ecf86ea42. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/apply-rule-based-guardrails-to-agent-traces-and-tool-flows-with-invariant before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Insert a trace-aware guardrail layer between an agent and its tools that blocks unsafe message patterns or sequences of tool calls via explicit rules.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: "Apply rule-based guardrails to agent traces and tool flows with Invariant"
slug: "apply-rule-based-guardrails-to-agent-traces-and-tool-flows-with-invariant"
version: "1.0.0"
displayName: "Apply rule-based guardrails to agent traces and tool flows with Invariant"
summary: "在代理和其工具之间插入一个跟踪感知的防护层,使不安全的消息模式或工具调用序列能够被显式规则阻止。"
license: "MIT"
description: "在代理和其工具之间插入一个跟踪感知的防护层,使不安全的消息模式或工具调用序列能够被显式规则阻止。"
github_stars: 409
verification: "security_reviewed"
source: "https://github.com/1991513ccie-png/skills"
author: "1991513ccie-png"
publisher_type: "individual"
category: "Security & Verification"
framework: "Multi-Framework"
tool_ecosystem:
  github_repo: "1991513ccie-png/skills"
  github_stars: 409
  npm_package: "invariant-ai"
  npm_weekly_downloads: 1473

使用Invariant对代理跟踪和工具流应用基于规则的防护

在代理和其工具之间插入一个跟踪感知的防护层,使不安全的消息模式或工具调用序列能够被显式规则阻止。

先决条件

Python环境或Invariant Gateway部署、目标LLM或MCP启用的代理工作流、防护规则或策略、用于评估的示例跟踪或实时请求

安装

来自上游的要求和注意事项:

  • 防护规则是简单的类Python匹配规则,可以编写这些规则来识别并防止恶意代理行为:
  • python
  • 这里,(msg: Message)会自动分配给每个可检查的消息,而第二行像常规Python一样执行。为了便于检查防护,Invariant附带了丰富的标准库操作,

基本用法或入门笔记:

文档

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供代理工作流的安全防护能力,具有明确实用价值
  • 适用于需要防止不安全消息模式和工具调用序列的场景
Trigger Precision85/100

Highlights

  • 触发描述清晰完整,准确反映防护层功能
  • description 位置正确,内容未截断
Structure and Standards65/100

Areas to improve

  • 缺少步骤划分和示例 Reported severity: Major

    文档缺少明确的 Phase/步骤划分和端到端示例

    Recommendation: 建议添加详细的执行步骤划分和完整的端到端使用示例

Execution Reliability70/100

Areas to improve

  • 异常处理说明不足 Reported severity: Minor

    缺少对主要异常的处理说明和不可逆操作的确认机制

    Recommendation: 建议补充异常处理说明和关键操作的确认机制

Evidence Verifiability (mean of the first four)74/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com
  • invariantlabs-ai.github.io
  • raw.githubusercontent.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.