Add Agent Skills support to the Common AI provider#67786
Merged
Conversation
bujjibabukatta
approved these changes
May 30, 2026
fa2989b to
c9a0249
Compare
Add AgentSkillsToolset, a pydantic-ai toolset that loads agentskills.io SKILL.md bundles from a local directory or a Git repository. Git credentials come from an Airflow git connection (HTTPS token or SSH key) resolved through the Git provider's GitHook: cleartext http and credential-bearing URLs are rejected, interactive credential prompts are disabled, and the token is stripped from the clone's .git/config. Sources are resolved on the worker when the agent enters the toolset, so a token is never baked into the serialized DAG, and clones are removed when the run ends. Pass it via AgentOperator's toolsets=, or use it with a raw pydantic-ai Agent. The framework-agnostic resolve_skills() helper returns local SKILL.md directories for other Agent Skills loaders (LangChain DeepAgents, Strands).
c9a0249 to
25903aa
Compare
gopidesupavan
approved these changes
May 31, 2026
Contributor
Backport failed to create: v3-2-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 86d8b47 v3-2-testThis should apply the commit to the v3-2-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
This was referenced May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Agent Skills support to the
common.aiprovider asAgentSkillsToolset, a pydantic-ai toolset (alongsideSQLToolset,HookToolset,MCPToolset). Skills areSKILL.mdbundles the model discovers and loads on demand (progressive disclosure), so a large skill library costs few tokens until a skill is actually used.Backed by the community pydantic-ai-skills package (MIT), pulled in only through the optional
skillsextra:pip install "apache-airflow-providers-common-ai[skills]"Why
pydantic-ai has no native skills primitive yet; native progressive disclosure is in flight upstream in pydantic/pydantic-ai#5230. This wires the community implementation in behind a small toolset so users get connection-based skill loading today, with a surface that maps onto the native primitive when it lands.
Design notes
Resolved at run time, not parse time. The underlying
SkillsToolsetloads its registries eagerly at construction, so building a Git-backed toolset in the DAG body would clone the repo while the DAG processor parses the file and bake the token into the serialized DAG.AgentSkillsToolsetinstead resolves connections and clones on__aenter__(when the agent enters the toolset, on the worker) and removes cloned directories on__aexit__. A Git token is never present in the serialized DAG; only theconn_idis.Reusable beyond the operator.
AgentSkillsToolsetis a normal pydantic-aiAbstractToolset, so it also works with a rawpydantic_ai.Agentyou build yourself (anywhere the Airflow connection backend is reachable). The operator is unchanged, skills are just a toolset.Framework-portable core. Because Agent Skills is a cross-framework format, the connection handling is exposed framework-agnostically through
resolve_skills(...), which returns localSKILL.mddirectories that any loader accepts (it needs only GitPython, no pydantic-ai):resolve_skillsneeds the Git provider (forGitSkills) but not pydantic-ai.Why not
pydantic-ai-skills'GitSkillsRegistry? It clones git too, but does its own credential handling (atokenarg plus a silentGITHUB_TOKENenv fallback, no Airflow-connection or SSH-key support). To take credentials from an Airflowgitconnection (HTTPS token or SSH key) and to keepresolve_skills()usable by non-pydantic frameworks (it returns plainSKILL.mddirectories, so LangChain/Strands users don't needpydantic-ai-skillsjust to clone), the clone goes throughGitHook+ GitPython instead. The tradeoff is some duplicated clone/scrub logic.Git, local only for now. Object storage (S3/GCS) is deferred so the recursive-download layout and lifecycle can be verified against a real bucket first.
Security and gotchas
run_skill_scripttool. This keeps the upstream default and is documented: pointGitSkillsat a trusted repository and pinbranchto a trusted ref.GitSkillscredentials come from an Airflowgitconnection resolved through the Git provider'sGitHook(HTTPS token in the password, or an SSH key in the extra). Credentials come only from the connection: omittingconn_idgives an anonymous clone, and plainhttp://withconn_idis rejected so a credential is never sent in cleartext. After cloning, the token is stripped from the checkout's.git/config. As with anygit clone, the worker's own git configuration (credential helpers, SSH agent) can still apply, so run workers without ambient git credentials if you need strict isolation.skillsextra pullsapache-airflow-providers-git(GitHook + GitPython) andpydantic-ai-skills(which requirespydantic-ai-slim>=1.74; the provider base floor stays at 1.71).Follow-ups
ObjectStoragePath).