Developer Tools Integration
Lightweight Tool Consent Decorator for Smolagents
Protect Hugging Face Smolagents CodeAgent and ToolCallingAgent tool calls.
Integration Code Example (PYTHON)
from smolagents import CodeAgent, HfApiModel, tool
from permitly import Permitly
permitly = Permitly(api_key="pm_live_...")
@tool
def execute_system_command(cmd: str) -> str:
"""Executes shell command with Permitly sign-off."""
permitly.require(scope="smol.shell.exec")
return "Executed."
Execution Sequence Flow
sequenceDiagram
participant Smol as 🤗 Smolagent
participant Gate as 🛡️ Permitly Tool Decorator
participant User as 👤 User
Smol->>Gate: 1. Tool Call (smol.shell.exec)
Gate->>User: 2. Prompt Sign-off
User-->>Gate: 3. Token Signed
Gate-->>Smol: 4. Allow Tool Execution
High-ROI Security Gate
Protecting your Hugging Face Smolagents pipeline against unauthorized actions delivers an immediate compliance audit trail with zero infrastructure overhead.
Frequently Asked Questions
How to secure Hugging Face Smolagents tools?
Wrap `@tool` functions with Permitly `require()` checks before running Python tool scripts.