Skip to main content

Secure secret fetching for CrewAI agents via 1claw HSM-backed vaults

Project description

1claw-crewai-tools

PyPI version Python versions License: MIT CI

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:

  1. A 1Claw account with a vault containing at least one secret.
  2. An agent registered in that org, bound to the vault (vault_ids), with a read policy on the secret path (e.g. demo/** or **).
  3. 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.
  • OneclawVaultTool sets CrewAI's cache_function to a callable that always returns False so credential reads are not cached by the framework.
  • CrewAI's verbose=True prints tool output including secrets to stdout — use verbose=False in production.

Repository

Source: github.com/1ClawAI/1claw-crewai-tools

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

1claw_crewai_tools-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

1claw_crewai_tools-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for 1claw_crewai_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8051692e57e84e543c9f996a07fe6c9254d7df11d7c8e171c291e7ed2ca951d1
MD5 cdd1ab9296b33a9f65dda10ea8104d86
BLAKE2b-256 bcc30324662bae39d51aa3b495e52f86bf575a5e4c561422c492de7c20f1d520

See more details on using hashes here.

Provenance

The following attestation bundles were made for 1claw_crewai_tools-0.1.0.tar.gz:

Publisher: publish.yml on 1clawAI/1claw-crewai-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file 1claw_crewai_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for 1claw_crewai_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53c63f7954ece6341a948648b3b590b5bea8f9b2f9accb8f91f8a745b25b5747
MD5 83cbf2400abc1e5db593c01f1ac1369b
BLAKE2b-256 9b8162f5010843146994d8d8df8f2e90f57255742a517d4e3114e36d22d0c07d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page