You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(declaredProviders.size>0&&!declaredProviders.has(provider))thrownewError(`Requested provider ${provider} is not declared by an authorized runtime provider plugin.`)
if(!Array.isArray(providers)||providers.length===0||providers.some((provider)=>!PROVIDER_ID.test(string(provider))))thrownewError(`${label}.metadata.providers must be a non-empty canonical list of provider ids.`)
if(canonicalProviders.length!==providers.length||providers.some((provider,index)=>provider!==canonicalProviders[index]))thrownewError(`${label}.metadata.providers must be a sorted, lowercase, duplicate-free canonical allowlist.`)
if(!SLUG.test(string(metadata.library))||!SLUG.test(string(metadata.strategy)))thrownewError(`${label}.metadata must declare library and strategy for a bundled library.`)
235
252
consttarget=string(metadata.target)
@@ -405,8 +422,9 @@ function pluginFileWithinSource(pluginFile, slug) {
thrownewError("Prepared runtime plugin source contents must never be staged for artifact upload.")
79
+
}
56
80
text=sanitizeText(text)
57
81
if(runtimeSourceRoot&&text.includes(runtimeSourceRoot))thrownewError("Runtime source paths must never be persisted in artifact uploads.")
58
82
awaitwriteFile(destination,redact(text))
@@ -77,6 +101,7 @@ async function assertNoPrivateRuntimePaths(directory) {
77
101
elseif(entry.isFile()){
78
102
constcontents=awaitreadFile(path,"utf8")
79
103
if(runtimeSourceRoot&&contents.includes(runtimeSourceRoot))thrownewError("Runtime source paths must never be persisted in artifact uploads.")
104
+
if(RUNTIME_SOURCE_TREE.test(path)||RUNTIME_SOURCE_FILE.test(entry.name)||RUNTIME_SOURCE_CONTENT.test(contents))thrownewError("Prepared runtime plugin sources must never be persisted in artifact uploads.")
Copy file name to clipboardExpand all lines: docs/agent-task-reusable-workflow.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ This release-coherence contract fixes [#1759](https://github.com/Automattic/wp-c
56
56
- `external_package_source`: immutable descriptor with `repository`, full commit `revision`, one package-relative `.agent.json` `path`, and `digest`. Packages are supported only from publicly accessible GitHub repositories, fetched from canonical `https://github.com/OWNER/REPOSITORY.git` without credentials. `digest` is exactly `sha256-bytes-v1:<lowercase-sha256>` over the raw file bytes; filenames and JSON content are UTF-8-safe and are not normalized before hashing.
57
57
- `EXTERNAL_PACKAGE_SOURCE_POLICY`: required reusable-workflow secret, supplied by the caller's operator-controlled secret configuration. Its strict version 1 JSON shape is `{"version":1,"repositories":{"owner/repository":["agents/example.agent.json"]}}`. Every entry is an exact standalone `.agent.json` path. The policy is validated in runner memory, is never part of task input, and is not uploaded.
58
58
59
-
`runtime_sources` is an optional versioned JSON array for immutable public runtime dependencies. Git descriptors declare `version: 1`, `role` (`component`, `provider_plugin`, or `bundled_library`), `repository`, a full 40-character `revision`, exact directory `path`, optional `sha256-git-archive-v1` digest, and role metadata. Component and provider descriptors may instead declare `source: {"type":"https_zip","url":"https://...","sha256":"<64 lowercase hex>","archive_root":"plugin-directory"}`. The operator-controlled policy separately authorizes Git sources with `runtime_sources` and exact ZIP URLs with `runtime_artifacts`, for example `{"version":1,"repositories":{},"runtime_artifacts":[{"url":"https://downloads.wordpress.org/plugin/example.zip","sha256":"<64 lowercase hex>"}]}`. Every exact `runtime_artifacts` URL requires `sha256`; the descriptor digest must exactly equal that trusted policy digest, so callers cannot authorize mutable current bytes. ZIP downloads require HTTPS, an exact allowlisted URL, a matching descriptor digest, bounded transfer and extraction sizes, and redirects only to another allowlisted URL on the original host. The runner verifies the digest before extraction; rejects traversal, symlink, special-file, encrypted, ZIP64, oversized, and multi-root archives; stages under a private temp root outside the workspace and artifacts; removes the staging root after execution; and strips private materialization paths from upload staging before scanning staged files for leaks. Runtime source descriptors lower into existing component, provider plugin, and runtime overlay inputs; artifacts retain provenance only.
59
+
`runtime_sources` is an optional versioned JSON array for immutable public runtime dependencies. Git descriptors declare `version: 1`, `role` (`component`, `provider_plugin`, or `bundled_library`), `repository`, a full 40-character `revision`, exact directory `path`, optional `sha256-git-archive-v1` digest, and role metadata. Every provider-plugin descriptor must declare `metadata.providers` as a sorted, lowercase, duplicate-free non-empty provider allowlist. The selected non-empty provider/model must be in that allowlist, and the model is passed only with that selected provider to the runtime package turn. Component and provider descriptors may instead declare `source: {"type":"https_zip","url":"https://...","sha256":"<64 lowercase hex>","archive_root":"plugin-directory"}`. The operator-controlled policy separately authorizes Git sources with `runtime_sources` and exact ZIP URLs with `runtime_artifacts`, for example `{"version":1,"repositories":{},"runtime_artifacts":[{"url":"https://downloads.wordpress.org/plugin/example.zip","sha256":"<64 lowercase hex>"}]}`. Every exact `runtime_artifacts` URL requires `sha256`; the descriptor digest must exactly equal that trusted policy digest, so callers cannot authorize mutable current bytes. ZIP downloads require HTTPS, an exact allowlisted URL, a matching descriptor digest, bounded transfer and extraction sizes, and redirects only to another allowlisted URL on the original host. The runner verifies the digest before extraction; rejects traversal, symlink, special-file, encrypted, ZIP64, oversized, and multi-root archives; stages under a private temp root outside the workspace and artifacts; removes the staging root after execution; and strips private materialization paths using the exact `mkdtemp` root handed from the executor as an ephemeral step output before scanning staged files for leaks. Runtime source descriptors lower into existing component, provider plugin, and runtime overlay inputs; artifacts retain provenance only.
0 commit comments