← Back to Skills Marketplace
anderskev

Pydantic Ai Dependency Injection

by Kevin Anderson · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
172
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install pydantic-ai-dependency-injection
Description
Implement dependency injection in PydanticAI agents using RunContext and deps_type. Use when agents need database connections, API clients, user context, or...
Usage Guidance
This skill is a documentation-pattern guide (no code to install). It's coherent with its purpose, but when you implement it: (1) avoid putting long-lived plaintext secrets into shared deps — prefer passing initialized client objects with minimal scopes; (2) only supply DB connections or API clients to agents you trust, since those deps grant runtime access to external systems; (3) follow the gates the SKILL.md suggests (ensure deps cover every ctx.deps access and tests pin shapes); and (4) rotate credentials and use least privilege for API keys used by agent-run tools. If you need extra assurance, review any code that uses these patterns before giving it production credentials.
Capability Analysis
Type: OpenClaw Skill Name: pydantic-ai-dependency-injection Version: 1.0.1 The skill bundle is a documentation and implementation guide for dependency injection in PydanticAI. The content in SKILL.md consists of standard code examples, type-safety patterns, and testing strategies aligned with the library's official documentation. No malicious code, data exfiltration attempts, or suspicious instructions were found.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The name and description (dependency injection for PydanticAI agents) match the content: SKILL.md provides patterns, examples, and gating/testing guidance. There are no unrelated env vars, binaries, or installs requested.
Instruction Scope
Instructions focus on typing and passing deps via RunContext and show realistic examples (DB connections, HTTP clients, api_key). They do not instruct the agent to read system files or exfiltrate data. Note: examples include using api_key and initialized clients in deps — that is expected for DI but means runtime behavior depends entirely on the credentials/clients you supply.
Install Mechanism
No install spec and no code files — instruction-only. This is lowest-risk in terms of disk writes or arbitrary downloads.
Credentials
The skill declares no required environment variables or credentials. However, example code shows API keys and client objects placed into deps at runtime; this is appropriate for the pattern but users must be aware they will be supplying secrets/clients to agents when using the pattern.
Persistence & Privilege
always is false, no requested config paths, and the skill does not request persistent presence or modify agent/system config. Autonomous invocation is allowed by platform default but is not a specific concern given this skill's instruction-only nature.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install pydantic-ai-dependency-injection
  3. After installation, invoke the skill by name or use /pydantic-ai-dependency-injection
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Added a new "Gates" section specifying step-by-step pass conditions for correct agent configuration. - No code or interface changes; SKILL.md documentation only. - Improves clarity and confidence in dependency usage and testing patterns.
v1.0.0
Initial release of pydantic-ai-dependency-injection. - Enables dependency injection in PydanticAI agents using RunContext and deps_type. - Supports both dataclasses and Pydantic models for defining dependencies. - Provides full type safety for dependencies and output models. - Describes patterns for using, accessing, and testing dependencies in tools, instructions, and system prompts. - Includes best practices for managing and scoping dependencies. - Allows overriding of dependencies for testing purposes.
Metadata
Slug pydantic-ai-dependency-injection
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Pydantic Ai Dependency Injection?

Implement dependency injection in PydanticAI agents using RunContext and deps_type. Use when agents need database connections, API clients, user context, or... It is an AI Agent Skill for Claude Code / OpenClaw, with 172 downloads so far.

How do I install Pydantic Ai Dependency Injection?

Run "/install pydantic-ai-dependency-injection" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Pydantic Ai Dependency Injection free?

Yes, Pydantic Ai Dependency Injection is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Pydantic Ai Dependency Injection support?

Pydantic Ai Dependency Injection is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Pydantic Ai Dependency Injection?

It is built and maintained by Kevin Anderson (@anderskev); the current version is v1.0.1.

💬 Comments