Skip to content
ai-supply.store
DiscoverCategoriesLeaderboardsCommunityAgent APIFAQ
Sign inSign up free
catalog / Orchestration / smolagents
◉AgentOrchestrationFree

smolagents

Hugging Face's minimalist library for building agents that write and execute Python code as their primary action.

@ai-supply
Installs167k
⟳ upstream v1.26.0 · updated 1mo ago
↗ Source repository
← More OrchestrationOrchestration leaderboard →How we grade security →Source ↗
✓ Grade A · 100/100 · SafeSecurity assessment
✓No compromise signals27capabilities surfaced9of 20 OWASP controls clear
Suspicious network referencesSuspicious network referencesBroad capability surfacePotentially unbounded loop
scanned 17d ago·osv · gitleaks · opengrep · picklescan + heuristics·full breakdown in the Security tab ↓

smolagents

smolagents is a barebones library from Hugging Face for building agents that think in code. The entire agent logic fits in ~1000 lines of code. CodeAgent writes actions as executable Python — enabling natural composability through loops, conditionals, and function calls — while ToolCallingAgent supports standard JSON tool-calling.

Key Features

  • Code-first agents: Actions are Python snippets executed in a sandboxed interpreter, not JSON blobs
  • Secure sandboxing: Execute code safely via Modal, E2B, Docker, or Blaxel
  • Any model: Works with Hugging Face models, OpenAI, Anthropic, local Ollama, and any LiteLLM-compatible provider
  • Hub integration: Share and load agents and tools directly as Hugging Face Spaces
  • Multi-agent: Compose agents hierarchically with a manager orchestrating specialists
  • Minimal surface area: Easy to audit, extend, and debug

Quick Start

pip install smolagents
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel

agent = CodeAgent(
    tools=[DuckDuckGoSearchTool()],
    model=HfApiModel("meta-llama/Llama-3.3-70B-Instruct")
)
agent.run("What were the biggest AI breakthroughs of 2025?")

Add to ai-supply

npx ai-supply add smolagents-code-agents

Curated mirror of the open-source smolagents (Apache-2.0). Get it from the source.

Rating rank
#1
of 16 in Orchestration
Install rank
#5
of 16 in Orchestration
Security score
100/100 · A
safe
Security rank
#1
of 16 in Orchestration
Installs
167k
cat avg 126k
This listing vs category average
Installs
this
cat avg
Security (of 100)
this
cat avg
Adoption trend
See the Orchestration leaderboard →
✓ Security: Safe · 100100/100 · grade Ascanned 17d ago
✓ no compromise signals27 risk-surface · 6/20 OWASP controls flagged

Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.

What this capability can do · high confidence (static)
Tools (4)
Agentsget_weather_infoecho_tooluser_info_tool
⚑ filesystem⚑ shell⚑ network⚑ secrets
egress → huggingface.co, www.contributor-covenant.org, www.apache.org, docs.github.com, circleci.com, img.shields.io, deepwiki.com, blaxel.ai +32

Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).

OWASP Top 10 for LLM Applications
⚠LLM05Improper Output Handlinghigh
Code that pipes model/user output into shell, eval, SQL or paths unsafely.
•Suspicious code patterns — destructive rm -rf /; OS command execution · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/secure_code_execution.md (CWE-78)expected
•Suspicious code patterns — OS command execution · huggingface-smolagents-6cfdf12/examples/open_deep_research/scripts/mdconvert.py (CWE-78)expected
•Suspicious code patterns — pickle deserialization · huggingface-smolagents-6cfdf12/src/smolagents/remote_executors.py (CWE-502)expected
•Suspicious code patterns — dynamic code execution · huggingface-smolagents-6cfdf12/src/smolagents/tools.py (CWE-95)expected
•Suspicious code patterns — environment/secret exfiltration · huggingface-smolagents-6cfdf12/tests/test_default_tools.py (CWE-200)expected
•Suspicious code patterns — OS command execution; dynamic code execution · huggingface-smolagents-6cfdf12/tests/test_local_python_executor.py (CWE-78)expected
⚠LLM06Excessive Agencyhigh
Over-broad tool/permission surface or unrestricted egress.
•External endpoints declared — 1 distinct host(s) · huggingface-smolagents-6cfdf12/.github/ISSUE_TEMPLATE/doc_improvement.mdexpected
•External endpoints declared — 2 distinct host(s) · huggingface-smolagents-6cfdf12/CODE_OF_CONDUCT.mdexpected
•External endpoints declared — 3 distinct host(s) · huggingface-smolagents-6cfdf12/CONTRIBUTING.mdexpected
•External endpoints declared — 13 distinct host(s) · huggingface-smolagents-6cfdf12/README.mdexpected
•External endpoints declared — 4 distinct host(s) · huggingface-smolagents-6cfdf12/docs/README.mdexpected
•External endpoints declared — 6 distinct host(s) · huggingface-smolagents-6cfdf12/docs/source/en/reference/models.mdexpected
•Broad capability surface — 3 high-impact capability categories referenced — verify least-privilege · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/inspect_runs.md (CWE-272)risk surface
•Egress to a private/loopback host — 0.0.0.0 · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/inspect_runs.md (CWE-918)expected
•External endpoints declared — 7 distinct host(s) · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/inspect_runs.mdexpected
•Egress to a private/loopback host — 127.0.0.1 · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/tools.md (CWE-918)expected
•External endpoints declared — 5 distinct host(s) · huggingface-smolagents-6cfdf12/docs/source/hi/tutorials/tools.mdexpected
•External endpoints declared — 11 distinct host(s) · huggingface-smolagents-6cfdf12/docs/source/ko/guided_tour.mdexpected
•External endpoints declared — 9 distinct host(s) · huggingface-smolagents-6cfdf12/examples/multiple_tools.pyexpected
•External endpoints declared — 8 distinct host(s) · huggingface-smolagents-6cfdf12/src/smolagents/models.pyexpected
⚠LLM10Unbounded Consumptionmedium
Unbounded loops/recursion causing DoS or runaway cost.
Enforced at runtime by the gateway (rate limits + spend caps + size caps); static check flags unbounded loops.
•Potentially unbounded loop — an infinite loop (while True / while(1) / for(;;)) may cause runaway consumption · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/secure_code_execution.md (CWE-835)risk surface
⚠LLM03Supply Chainlow
Vulnerable/compromised dependencies, models or archives in the artifact.
•Dependency manifest — 4 pip requirements declared · huggingface-smolagents-6cfdf12/examples/async_agent/requirements.txtrisk surface
•Dependency manifest — 39 pip requirements declared · huggingface-smolagents-6cfdf12/examples/open_deep_research/requirements.txtrisk surface
§LLM09MisinformationGovernance
Artifacts designed to produce false/deceptive output.
Detectable only by runtime behavioral evaluation; addressed via responsible-use attestation.
✓LLM01Prompt InjectionPassed
✓LLM02Sensitive Information DisclosurePassed
✓LLM04Data and Model PoisoningPassed
Backdoors/poisoning in training data or serialized models.
Behavioral poisoning needs model execution; static check covers unsafe serialization + dataset skew only.
✓LLM07System Prompt LeakagePassed
✓LLM08Vector and Embedding WeaknessesPassed
PII or plaintext source leakage in embedding/vector exports.
Embedding inversion/poisoning is largely runtime; static check covers PII in vector exports.
OWASP Machine Learning Security Top 10
⚠ML09Output Integrityhigh
Middleware tampering with model outputs in transit.
Gateway enforces TLS + response integrity; static check flags output-rewriting code.
•Suspicious code patterns — destructive rm -rf /; OS command execution · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/secure_code_execution.md (CWE-78)expected
•Suspicious code patterns — OS command execution · huggingface-smolagents-6cfdf12/examples/open_deep_research/scripts/mdconvert.py (CWE-78)expected
•Suspicious code patterns — pickle deserialization · huggingface-smolagents-6cfdf12/src/smolagents/remote_executors.py (CWE-502)expected
•Suspicious code patterns — dynamic code execution · huggingface-smolagents-6cfdf12/src/smolagents/tools.py (CWE-95)expected
•Suspicious code patterns — environment/secret exfiltration · huggingface-smolagents-6cfdf12/tests/test_default_tools.py (CWE-200)expected
•Suspicious code patterns — OS command execution; dynamic code execution · huggingface-smolagents-6cfdf12/tests/test_local_python_executor.py (CWE-78)expected
⚠ML06AI Supply Chainlow
Compromised PyPI/npm packages, typosquats, unsafe serialized models.
•Dependency manifest — 4 pip requirements declared · huggingface-smolagents-6cfdf12/examples/async_agent/requirements.txtrisk surface
•Dependency manifest — 39 pip requirements declared · huggingface-smolagents-6cfdf12/examples/open_deep_research/requirements.txtrisk surface
§ML01Input Manipulation (Adversarial)Governance
Models vulnerable to adversarial perturbations.
Requires runtime robustness evaluation; addressed via publisher robustness attestation.
§ML03Model InversionGovernance
Training data reconstructable from a model's outputs.
Runtime/evaluation property; addressed via model-card data-provenance + DP attestation.
§ML04Membership InferenceGovernance
Determining whether a record was in the training set.
Runtime/evaluation property; addressed via overfitting disclosure + DP attestation.
§ML08Model SkewingGovernance
Models trained on skewed data producing biased output.
Requires fairness evaluation; addressed via model-card bias/limitations disclosure.
✓ML02Data PoisoningPassed
Poisoned training datasets with triggers or anomalous distributions.
Static check covers trigger phrasing, PII and label skew; full poisoning detection is runtime.
✓ML05Model TheftPassed
Unlicensed re-distribution / license-incompatible derivatives.
Static check verifies license declaration; extraction throttling is runtime.
✓ML07Transfer Learning AttackPassed
Backdoored base models / LoRA adapters propagating to derivatives.
Backdoor detection needs behavioral probing; static check covers unsafe serialization + provenance.
✓ML10Model Poisoning (Weights)Passed
Tampered model weight files; integrity must be verifiable.
Static check enforces safe formats + records a content hash for downstream verification.
Other findings (8) · hygiene / uncategorized
•Unrecognized file type — '.gitignore' is not on the allowlist · huggingface-smolagents-6cfdf12/.gitignorerisk surface
•Unrecognized file type — '.?' is not on the allowlist · huggingface-smolagents-6cfdf12/LICENSErisk surface
•Suspicious network references — suspicious TLD (50 URLs) · huggingface-smolagents-6cfdf12/README.mdrisk surface
•Suspicious network references — raw IP URL (15 URLs) · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/inspect_runs.mdrisk surface
•Suspicious network references — raw IP URL (13 URLs) · huggingface-smolagents-6cfdf12/docs/source/en/tutorials/tools.mdrisk surface
•Suspicious network references — raw IP URL (5 URLs) · huggingface-smolagents-6cfdf12/docs/source/hi/tutorials/inspect_runs.mdrisk surface
•Suspicious network references — raw IP URL (14 URLs) · huggingface-smolagents-6cfdf12/docs/source/ko/tutorials/inspect_runs.mdrisk surface
•Suspicious network references — raw IP URL (3 URLs) · huggingface-smolagents-6cfdf12/src/smolagents/tools.pyrisk surface
✔ verified source · pinned huggingface-smolagents-6cfdf12
Check against a policy

The same gate an agent runs before installing (POST /api/v1/trust/smolagents-code-agents/check). Click a policy:

Consume smolagents programmatically. Authenticate with an API key or session — see Authorize an agent.

# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/smolagents-code-agents

# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/smolagents-code-agents/check \
  -H "Content-Type: application/json" \
  -d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'

# CLI
npx ai-supply add smolagents-code-agents

# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/smolagents-code-agents/install \
  -H "Authorization: Bearer $AIM_KEY"

# MCP tool
install_listing({ "slug": "smolagents-code-agents" })
OpenAPI spec →
vlatest
✓ Security: Safe · 1001mo ago

Curated mirror — latest upstream source. See the repository for tagged releases.

Sign in and install this listing to leave a review.

More from @ai-supply

View profile →
◉Agent
MetaGPT
Multi-agent framework that assigns GPT roles (PM, engineer, QA) to solve complex software tasks end-to-end.
↓ 1.0M
⇄Connector
vLLM
High-throughput, memory-efficient LLM inference engine with PagedAttention and continuous batching.
↓ 892k
⇄Connector
Meilisearch
Lightning-fast open-source search engine with typo-tolerance, semantic hybrid search, and sub-50ms response times.
↓ 811k
△Eval
Weights & Biases (wandb)
ML experiment tracking and visualization — log metrics, hyperparameters, models, and media in real time.
↓ 784k
ai-supply.store

Free, security-vetted AI capabilities — skills, MCPs, plugins, agents, datasets and more, each graded and freshness-tracked, and built for humans and agents alike.

api · v3.1status · all green
Contact
support@ai-supply.storesecurity@ai-supply.store
Catalog
  • Discover
  • Categories
  • Leaderboards
  • Benchmarks
  • Security
  • Scan a repo
Community
  • Community
  • FAQ
For agents
  • Quickstart (60s)
  • Authorize an agent
  • Agent API
  • OpenAPI spec
For builders
  • Publish
  • Dashboard
Account
  • Create account
  • Sign in
  • Settings
Legal
  • Terms
  • Publisher Agreement
  • Acceptable Use
  • Privacy