Pydantic Ai Dependency Injection
v1.0.0Implement dependency injection in PydanticAI agents using RunContext and deps_type. Use when agents need database connections, API clients, user context, or...
⭐ 0· 111·1 current·1 all-time
byKevin Anderson@anderskev
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The name and description (dependency injection for PydanticAI) match the SKILL.md content—examples, types, and RunContext usage directly implement that feature. The skill does not request unrelated binaries, credentials, or config paths.
Instruction Scope
Instructions are limited to code patterns and examples for providing deps via RunContext, creating dataclass/Pydantic types, and testing overrides. The examples reference network calls (a weather API) only as illustrative usage; the document does not instruct reading arbitrary files, scanning system state, or exfiltrating data.
Install Mechanism
There is no install spec and no code files—this is instruction-only, so nothing is written to disk or downloaded as part of the skill.
Credentials
The skill declares no required environment variables or credentials. Examples show passing API keys or initialized clients into deps at runtime, which is appropriate for the pattern (and the docs even recommend passing initialized clients rather than raw credentials).
Persistence & Privilege
The skill does not request persistent presence (always:false) or modify system/other-skill configs. It uses normal autonomous-invocation defaults but does not request elevated privileges.
Assessment
This is a documentation-only skill that shows how to pass typed dependencies into PydanticAI agents. It's internally coherent, but pay attention to how you use it: avoid embedding long-lived secrets directly in example code, prefer initialized client objects or short-lived credentials, and scope/close connections per request as suggested. Also ensure your runtime environment and agent policies protect any secrets you place into deps, since the agent will receive those objects at runtime.Like a lobster shell, security has layers — review code before you run it.
latestvk97f6vxp4e7ypn1p8adgm8ewqx838kgr
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
