Secure secret fetching for CrewAI agents via 1claw HSM-backed vaults
Project description
1claw-crewai-tools
Secure secret fetching for CrewAI agents via 1Claw HSM-backed vaults.
Credentials are retrieved at runtime from your vault using a scoped agent identity — not copied into prompts, repos, or long-lived agent memory. Do not log tool return values.
Install
PyPI distribution name: 1claw-crewai-tools. Python import package: oneclaw_crewai.
pip install 1claw-crewai-tools
Usage
import os
from crewai import Agent, Crew, Process, Task
from oneclaw_crewai import OneclawVaultTool
vault_tool = OneclawVaultTool(
agent_id=os.environ["ONECLAW_AGENT_ID"],
api_key=os.environ["ONECLAW_AGENT_API_KEY"],
vault_id=os.environ["ONECLAW_VAULT_ID"],
)
agent = Agent(
role="Engineer",
goal="Build features using vault-stored API keys",
backstory="You use tools instead of pasted secrets.",
tools=[vault_tool],
verbose=True,
)
task = Task(
description="Read path api-keys/example using the vault tool; do not echo raw values in logs.",
expected_output="Confirmation that the path was read.",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task], process=Process.sequential)
crew.kickoff()
Testing
Unit tests (offline, no credentials needed)
# From the package root:
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -v # 10 tests — client + tool
ruff check src tests examples
mypy
All network calls are mocked with respx; no 1Claw account is required.
Live integration test (requires 1Claw + LLM key)
examples/test_live.py runs three progressive phases against the real API:
| Phase | What it validates |
|---|---|
| 1 | Raw OneclawClient — agent token exchange + get_secret (no CrewAI) |
| 2 | Single-agent crew — CrewAI invokes oneclaw_vault tool, LLM reports result |
| 3 | Two-agent crew — fetcher reads secret, writer produces unrelated output |
Prerequisites:
- A 1Claw account with a vault containing at least one secret.
- An agent registered in that org, bound to the vault (
vault_ids), with a read policy on the secret path (e.g.demo/**or**). - An LLM API key — OpenAI (
OPENAI_API_KEY) or Google Gemini (GOOGLE_API_KEY).
For Gemini, install the provider extra: pip install "crewai[google-genai]".
Run:
export ONECLAW_AGENT_ID="<agent-uuid>"
export ONECLAW_AGENT_API_KEY="ocv_..."
export ONECLAW_VAULT_ID="<vault-uuid>"
export GOOGLE_API_KEY="..." # or OPENAI_API_KEY
python examples/test_live.py demo/api-key
The script accepts an optional secret path argument (defaults to test/crewai-live).
Example output (Phase 2):
╭─── 🔧 Tool Execution Started (#1) ───╮
│ Tool: oneclaw_vault │
│ Args: {'path': 'demo/api-key'} │
╰───────────────────────────────────────╯
╭─── ✅ Agent Final Answer ────╮
│ Fetch succeeded, │
│ character length: 32. │
╰──────────────────────────────╯
Known issues and gotchas
| Issue | Details |
|---|---|
| Tool name must be a valid identifier | OpenAI (and other providers) require function names to start with a letter or underscore. The tool is named oneclaw_vault — not 1claw Vault — for this reason. If you subclass and change name, keep it alphanumeric + underscores, starting with a letter. |
| CrewAI verbose logging prints secret values | When verbose=True, CrewAI's internal executor logs the raw return value of every tool call. This is a CrewAI framework behaviour, not this package. In production, set verbose=False or redirect stdout. |
| Google Gemini requires an extra | pip install "crewai[google-genai]" — without it, LLM(model="gemini/...") raises ImportError. |
cache_function must be a callable |
CrewAI's BaseTool.cache_function field is typed as Callable[..., bool], not bool. This package sets it to a function that always returns False. If you override it, pass a callable, not a bare False. |
Documentation
- Quickstart — prerequisites, env vars, paths, security, troubleshooting
- 1Claw docs — vaults, agents, policies
Security
- Tool output can contain plaintext credentials. Never
print()or log the return value of_run/ tool execution. OneclawVaultToolsets CrewAI'scache_functionto a callable that always returnsFalseso credential reads are not cached by the framework.- CrewAI's
verbose=Trueprints tool output including secrets to stdout — useverbose=Falsein production.
Repository
Source: github.com/1ClawAI/1claw-crewai-tools
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 1claw_crewai_tools-0.1.0.tar.gz.
File metadata
- Download URL: 1claw_crewai_tools-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8051692e57e84e543c9f996a07fe6c9254d7df11d7c8e171c291e7ed2ca951d1
|
|
| MD5 |
cdd1ab9296b33a9f65dda10ea8104d86
|
|
| BLAKE2b-256 |
bcc30324662bae39d51aa3b495e52f86bf575a5e4c561422c492de7c20f1d520
|
Provenance
The following attestation bundles were made for 1claw_crewai_tools-0.1.0.tar.gz:
Publisher:
publish.yml on 1clawAI/1claw-crewai-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
1claw_crewai_tools-0.1.0.tar.gz -
Subject digest:
8051692e57e84e543c9f996a07fe6c9254d7df11d7c8e171c291e7ed2ca951d1 - Sigstore transparency entry: 1310217152
- Sigstore integration time:
-
Permalink:
1clawAI/1claw-crewai-tools@d924a98fd6fdc7b58cb8bed4d0e523db47df686f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/1clawAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d924a98fd6fdc7b58cb8bed4d0e523db47df686f -
Trigger Event:
push
-
Statement type:
File details
Details for the file 1claw_crewai_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: 1claw_crewai_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53c63f7954ece6341a948648b3b590b5bea8f9b2f9accb8f91f8a745b25b5747
|
|
| MD5 |
83cbf2400abc1e5db593c01f1ac1369b
|
|
| BLAKE2b-256 |
9b8162f5010843146994d8d8df8f2e90f57255742a517d4e3114e36d22d0c07d
|
Provenance
The following attestation bundles were made for 1claw_crewai_tools-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on 1clawAI/1claw-crewai-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
1claw_crewai_tools-0.1.0-py3-none-any.whl -
Subject digest:
53c63f7954ece6341a948648b3b590b5bea8f9b2f9accb8f91f8a745b25b5747 - Sigstore transparency entry: 1310217259
- Sigstore integration time:
-
Permalink:
1clawAI/1claw-crewai-tools@d924a98fd6fdc7b58cb8bed4d0e523db47df686f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/1clawAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d924a98fd6fdc7b58cb8bed4d0e523db47df686f -
Trigger Event:
push
-
Statement type: