Skip to main content

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.

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.1.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.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file 1claw_crewai_tools-0.1.1.tar.gz.

File metadata

  • Download URL: 1claw_crewai_tools-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b8bf0e1c6ff1aafeac9710ea5f9d31094593690d86babbff86ac914528286148
MD5 c9bbbf9495ba7c5b17998e4258ae8f5c
BLAKE2b-256 74e1cbe19fb5ebf9fd3c0016893fb2836f5d13858019fc52611fad71c4f03dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for 1claw_crewai_tools-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for 1claw_crewai_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d180e94660b1d406be3d88c0cc6b11a06949281b080929b925611bd305bc1186
MD5 c89b09c6b7768de6c7a4c446c3b91642
BLAKE2b-256 23781988264688e532eeb446b0cb3c547b801d04745ab99fd97d4bcca137cd7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for 1claw_crewai_tools-0.1.1-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