Repository navigation
Description
Outcome
A user can create a schedule for a fixed agent and operation. Timer and "run now" executions act only within that user-approved scope, until expiry or revocation.
Proposed approach
- The authenticated owner's successful schedule create/update request is the recorded consent event; there is no mandatory second Mecatl consent screen.
- The schedule binds an exact agent revision, integration, operation, target, cadence, expiry, and execution limits.
- It references a signed Scheduled Authority Grant, not a user login token, provider access token, or provider refresh token.
- The protected authority service holds any provider refresh credential.
- Every fire checks the current grant state, schedule state, policy, agent/integration revision, and exact requested operation before obtaining fresh short-lived authority.
- Expiry, revocation, drift, missing credentials, and unavailable/indeterminate policy fail closed.
- Manual and timer fires share one authority path.
Not in this issue
A generic approval UI, broker replication, service-identity fallback, or silently using "latest" agent/integration configuration.
Dependencies
The protected-operation authority path from #1564 (external action without exposed credentials). Provider OAuth consent, including any offline_access request, remains in the interactive provider-connection flow; it is separate from Mecatl's schedule-create consent event.
Proof
- An expired or revoked schedule never executes under service/ownerless authority and names the reason.
- A schedule cannot fire as a different agent, integration, target, or broadened operation.
- Manual and automatic fires have the same effective authority.
- Provider credentials never enter Mecatl state or model-visible output.
Hazards (carried over from the original issue body)
Facts that were expensive to find and that nobody re-derives on the way to implementing. Each is verified against code.
- Never fall back to a service identity when the user's grant expires. That turns an expiry into an escalation.
- The model must not be able to author the consent record.
- An absent user cannot consent at fire time, so capture-at-create is the only user-consent path for unattended work. The alternative is an admin pre-authorizing a class of agents, which substitutes organizational authority for the user's. There is no third option, and which one applies should be a stated decision rather than a consequence of the implementation.
- "Signed" is worth whatever the signing key's custody is worth. A key held in the agent-loop process is reachable from a shell the model drives without touching memory — see Spike: can a model-spawned shell reach the key? #375 for the verified evidence.
Correction to the previous version of this issue
The previous body said authority is replayed "with no live lookup that can fail or drift." That claim does not hold: the signed grant prevents unauthorized row mutation, but only authoritative fire-time checks (grant state, schedule state, policy, credential availability) make revocation, disablement, current policy, and provider-connection loss effective. The design must not silently turn an outdated signature into continuing authority — every fire re-checks live state, per the "Proposed approach" above.
Activity
[-]EP7: a scheduled run acts with bounded, consented authority[/-][+]A scheduled run acts with bounded, consented authority[/+]JAORMX commentedon Aug 5, 2026
(mecatl comment, posted on Juan's behalf — color from the #377 Q5 discussion.)
The "consent is a signed artifact" criterion quietly makes this issue the consent-record holder decision point, and the #377 discussion converged on naming it: the schedule grant is the one consent artifact the design already makes forgery-resistant — signed envelope, verified before every fire, a confirmation interaction the model can't author. When per-agent consent ("which named agents may use Alice's GitHub") gets built, the record most naturally lives wherever this envelope lives, with the same properties. Worth stating in the design notes here so the two don't get built as separate stores with separate signing and verification paths.
Two threads from that discussion that sharpen criteria already in this issue:
Also +1 on "manual and automatic fires share one path" — that's the "identity is either derived from a verified credential or absent, no third state" discipline applied to the schedule seam.
jhrozek commentedon Aug 5, 2026
The consent-record holder question got answered while reading the drafts, and it points back here.
Nothing needs to hold a per-agent consent record that this envelope wouldn't already do better. Every IETF draft that scopes consent puts an AS-signed artifact keyed on the agent definition, and the closest thing to a format worth borrowing is Liu et al.'s
authorization_evidence(draft-liu-ai-agent-authorization-integration-00): an object inside RFC 9396authorization_detailscarryingdisplayed_content,user_actionand a timestamp, signed. That is the shape this issue's criterion already asks for, a record of the confirmation act the model cannot author. It is an individual draft with no standing, so borrow the format, not the dependency.On who signs the envelope. The issuer is now sequenced behind the reachability spike (#375) rather than deferred out of the plan, because the FS grant service needs it. So a mecatl-signed envelope is nearer than it looked. The constraint stands either way: pick a signature scheme a mecatl-issued key can occupy later without a format migration.
One caveat on that, from the security pass on #374. A signing key held in the agent-loop process is reachable from a shell the model drives, three ways, without touching memory. A flag lands in
/proc/<pid>/cmdline. An env var is readable at the parent's/proc/<pid>/environ, since envscrub only strips names from the child's environment. A mounted Secret file is a fixed path, andcatis classified read-only by verb with no path predicate, so an isolated child auto-approves reading it. "Signed by mecatl" is therefore worth whatever the key's custody is worth, which is what #375 is now measuring. An AS-signed envelope does not have that problem today, which is an argument for not waiting on our own signing identity to get the envelope built.And the shape problem should be stated in the issue, for whoever signs off on the schedule feature. An absent user cannot consent at fire time. So consent is either captured when the schedule is created, or an admin pre-authorizes a class of agents, which substitutes organizational authority for the user's. There is no third option. That choice deserves to be explicit rather than arrive as a consequence of the implementation.
jhrozek commentedon Aug 5, 2026
Correction to my previous comment, and a reframe.
The consent model is spike work, not epic work, so this issue no longer tries to settle it. I had written the record's keying into the acceptance criteria as though it were decided; it isn't, and it needs a proper design pass. The body now carries a "consent model is a spike first" section with the questions left open on purpose: who holds the record and who signs it, what it is keyed on, what format to borrow, where consent is captured for unattended work, and whether it must verify with the authorization server unreachable.
The current leaning on keying, recorded as a leaning rather than a decision: the definition carries the authorization and an instance or session id rides alongside for audit correlation only. That is the shape in
draft-liu-ai-agent-authorization-integration-00, whereact.subauthorizes andagent_user_idcorrelates. It reconciles wanting instance attribution with the fact that no relying party can act on an instance name today. The spike can overturn it.What stays as acceptance criteria here is the part that isn't consent design: the owner captured at create and replayed at every fire with no live lookup, the grant's lifetime bounded by the schedule's, expiry failing closed with a reason distinguishable from a transient error, manual and automatic fires sharing one path, and the model not being the author of the artifact whatever its shape turns out to be.
One constraint survives the spike either way: pick a signature scheme a mecatl-issued key can occupy later without a format migration.
jhrozek commentedon Aug 11, 2026
Hazard, verified against code — the schedule's
workspaceis a model-authored authority field today.ScheduleArgs.Workspace(engine/agent/scheduletool.go:64) is model-suppliedand reaches
port.ScheduleSpecverbatim (:386). Nothing on the path validatesit as a path.
scheduleManager.validateScheduleSpec(
internal/adapter/server/schedule_manager.go) checks presence, profile-aware— a default-profile schedule must have a non-empty workspace, a
no-fsone musthave none — and
Service.createSession(internal/adapter/server/service.go)repeats the same presence check. At fire time
internal/app/scheduler_fire.go:86hands the spec's workspace straight toCreateSessionWithProfile, andosfsWorkspaceFactory(
internal/app/build.go:6979) roots the fire session'sosfsworkspace there,building the escape classifier from that same root — so no containment
check can fire, the same way none fires in #448. There is no
filepath.Rel/Clean/IsAbsanywhere on the path.This makes the fire's filesystem authority strictly a function of a value the
model writes, one turn removed, and it is not bounded by the deployment's
--workspace. Concretely it defeats #448's stated mitigation: a model with theSchedule tool creates a schedule with
workspace: "/", fires it in the sameturn (
FireNow, and the mecak8s scheduler is on by default —cmd/mecak8s/flags.go:287), and the fire'sReadserves/var/run/secrets/kubernetes.io/serviceaccount/token. ADR 0075 fire-resultdelivery then routes the result back to the creating session.
Four details that cost time to establish and that nobody should re-derive:
registerScheduleTool(
internal/app/catalog.go) gates only on the store exposing aport.ScheduleStore— true for jsonlstore (jsonlstore.go:393), redisstoreand grpcdriver; only the in-memory
memstorelacks it. And it isfloor-scoped Allow in
defaultRules()(internal/app/build.go), so itnever asks.
planAwareScheduleTool(
engine/agent/scheduletool.go:262-330) denies only amutating: truecreate and the fire of a mutating schedule. A
mutating: falsecreatepasses, and its fire runs in
ModePlan— which still has Read/Grep/Glob.NewSessionOriginScheduleManager(
engine/agent/sessionorigin.go) stampsOriginSessionIDonly;validateScheduleOriginloads that session purely to prove it exists. Thecreating session's root is available at exactly that point and is not read.
This is the natural capture site for AC1.
no-fssession can mint a filesystem one. The Schedule tool isregistered in both profiles by design (
catalog.go: "managing a schedule isnot a filesystem act"), and a
no-fssession may create adefault-profile schedule. Whatever bounds the fire has to hold when the
creating session has no filesystem authority at all.
Proposed additional proof bullet: a session rooted at a project directory
creates a schedule naming a workspace outside it, then fires it; the create is
refused, or the fire runs bounded by the creating session's root. Both halves
tested, so "the fire failed" cannot pass for "the fire was bounded".
Also worth a line in #438: its authority-value criterion says "which paths", and
#371's slice says "the three spawn seams" — a schedule fire is a fourth
derivation point that is not a spawn (it is a fresh top-level session minted in
internal/app/scheduler_fire.go), so an implementation that intersects atSubagent/Parallel/Team can satisfy every listed criterion while leaving this
open.
A cheap interim mitigation, independent of the identity work (in the spirit of
#448's second suggestion): reject a schedule create whose
Workspaceis not thecreating session's root, or a subpath of it, in
validateScheduleSpec— where theorigin session is already being loaded. That is a create-seam check in the one
place the tool and the REST/gRPC handlers already funnel through, so it needs no
second enforcement path.
Provenance: established by reading code, with the citations above. Not
demonstrated end to end — a scheduled fire reading the token was not observed, so
treat this as code-established rather than empirically proven.
jhrozek commentedon Aug 12, 2026
Dependency note, surfaced while fixing an unrelated-looking bug.
This epic's first acceptance criterion —
— rests on schedule origin capture being correct, and on
mainit was not. #482: two concurrent sessions on a sharedEnginecould interleave between the per-run origin bind and theScheduletool's execution, so one session stamped another session's id as a schedule'sOriginSessionID— and, becausecaptureScheduleOwner(ADR 0100 decision 6) resolves the owner from that origin, the schedule inherited the other session's owner principal. Atomic access prevented the data race but not the mis-attribution.Why that matters here specifically: "captured when it is created" was already the design, and the capture itself was the broken step. Any consent artifact built on top would have been correctly signed, correctly bounded, and attributed to the wrong creator — a failure this epic's proof section would not catch, since every listed adversarial case holds while the captured identity is simply the wrong one. The AC's "no live lookup that can fail or drift" is satisfied either way, which is what made it invisible.
Fixed in #484 (merged/pending): attribution moved onto the run context, stamped in
startRunand read at the single site that builds theScheduleSpec. Both run-entry seams (Run,ResumeApproval) route throughstartRun, so an awaiting-approval resume attributes identically to a normal run — relevant to the fourth AC here ("manual and automatic fires share one path"), since that path now has one origin source rather than one per seam.So #482 is a precondition for this epic rather than part of it. No action implied for the consent-model spike beyond being able to assume the creator identity reaching it is now the right one.
One thing worth carrying into the spike, from ADR 0104's consequences:
validateScheduleOriginchecks only that the origin session exists, not that the caller owns it. Today the only thing stopping an embedder from naming an arbitrary session as origin is that no exported writer for the origin context value exists. If this epic's design ever needs to attribute a schedule created outsideEngine.Run, that ownership check has to land first — otherwise exporting the writer silently reopens exactly what #482 closed.[-]A scheduled run acts with bounded, consented authority[/-][+]Run scheduled tasks with bounded, revocable user authority[/+]ChrisJBurns commentedon Oct 26, 2026
Superseded by #2569 (Scheduled runs: schedule grants), part of phase 2 of the agent identity work (#2545).
#2569 follows the merged agent identity design, so it doesn't use the signed Scheduled Authority Grant proposed here. A schedule grant is set up from the user's AS-1 token while the user is present, and the broker stores it under the schedule. When the schedule fires, the scheduled session passes the schedule ID, and the broker exchanges the stored grant for a refresh token that expires no later than the grant's horizon.
This issue's outcome and proof carry over as #2569's acceptance criteria, each with a test:
Closing in favour of #2569.