Support excluding files from common.ai Agent Skills discovery#69924
Merged
Conversation
`AgentSkillsToolset` now accepts an optional `exclude_resources` list of glob
patterns, forwarded to `pydantic-ai-skills`' `SkillsToolset`, to keep matched
files out of a skill's discovered resources. It mirrors the existing
`exclude_tools` escape hatch and is resolved per-run on the worker.
pydantic-ai-skills 1.2.0 broadened resource discovery from a fixed
seven-extension allowlist to every readable text file in a skill bundle, so
`.sql`/`.toml`/`.jinja` assets are exposed with no extra config. That also
widens what reaches the model, so `exclude_resources` is the trim knob for
secrets or scratch files (e.g. `["*.env", "secrets/*"]`). It removes files from
resource discovery only, not from `run_skill_script` filesystem access, so pair
it with `exclude_tools={"run_skill_script"}` when files are genuinely sensitive.
The `[skills]` floor moves to `pydantic-ai-skills>=1.2.0` (the version that adds
the parameter). 1.2.0 was published inside the repo's 4-day exclude-newer
window, so a temporary per-package `exclude-newer-package` override lets it
resolve; remove it once the window advances past 2026-07-15.
This was referenced Jul 15, 2026
joshuabvarghese
pushed a commit
to joshuabvarghese/airflow
that referenced
this pull request
Jul 16, 2026
…he#69924) `AgentSkillsToolset` now accepts an optional `exclude_resources` list of glob patterns, forwarded to `pydantic-ai-skills`' `SkillsToolset`, to keep matched files out of a skill's discovered resources. It mirrors the existing `exclude_tools` escape hatch and is resolved per-run on the worker. pydantic-ai-skills 1.2.0 broadened resource discovery from a fixed seven-extension allowlist to every readable text file in a skill bundle, so `.sql`/`.toml`/`.jinja` assets are exposed with no extra config. That also widens what reaches the model, so `exclude_resources` is the trim knob for secrets or scratch files (e.g. `["*.env", "secrets/*"]`). It removes files from resource discovery only, not from `run_skill_script` filesystem access, so pair it with `exclude_tools={"run_skill_script"}` when files are genuinely sensitive. The `[skills]` floor moves to `pydantic-ai-skills>=1.2.0` (the version that adds the parameter). 1.2.0 was published inside the repo's 4-day exclude-newer window, so a temporary per-package `exclude-newer-package` override lets it resolve; remove it once the window advances past 2026-07-15.
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.
AgentSkillsToolsetgains an optionalexclude_resourcesparameter — a list of glob patterns forwarded topydantic-ai-skills'SkillsToolsetthat keeps matched files out of a skill's discovered resources. It mirrors the existingexclude_toolsescape hatch and is resolved per-run on the worker (so nothing is baked into the serialized DAG).Why now
pydantic-ai-skills1.2.0 broadened resource discovery from a fixed seven-extension allowlist (.md/.json/.yaml/.yml/.csv/.xml/.txt) to every readable text file in a skill bundle, so.sql,.toml,.jinja, and similar assets are exposed with no extra config (DougTrajano/pydantic-ai-skills#54, #55).That broader discovery also means more files reach the model, so
exclude_resourcesis the trim knob for secrets or scratch files that happen to live in a skill directory. The two ship together: broaden discovery, and give users a way to narrow it back.Usage
Patterns extend the built-in defaults (
__pycache__,*.pyc,*.pyo,.DS_Store,.git) and match either the full skill-relative path or any single path component.Scope of the guarantee
exclude_resourceshides files from resource discovery only — the resource list and theread_skill_resourcetool. It does not stop a skill'srun_skill_scriptfrom reading an excluded file off disk (a skill script runs as a subprocess with the worker's filesystem permissions). When files are genuinely sensitive, pair it withexclude_tools={"run_skill_script"}. This is called out in both the docstring and the toolset guide.Packaging notes
[skills]extra floor moves topydantic-ai-skills>=1.2.0(the version that adds the parameter).exclude-newer = "4 days"window, so a temporary per-packageexclude-newer-packagecutoff (2026-07-16T00:00:00Z) is added in both[tool.uv.exclude-newer-package]and[tool.uv.pip.exclude-newer-package]so it resolves. The comment marks it for removal once the rolling window advances past 2026-07-15.uv.lockfor the floor bump also picked up pre-existing drift onmainunrelated to this change: theopenaiprovider had already dropped its[datalib]extra inpyproject.tomlbut the lock was never refreshed, andcommon-dataqualityis re-sorted.uv lockalways fully syncs, so this churn is unavoidable when touching the lock.