Action Precondition Checking
Description
Verify declared preconditions such as existence, permissions, quotas, and states before executing an action, and fail closed with reasons when one does not hold. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.
When to Use
- Multiple inputs or candidates compete and must be resolved by explicit criteria.
- A wrong intermediate result would propagate into consequential actions.
- The task repeats and benefits from a deterministic procedure.
Inputs / Outputs
| Area |
Contract |
| Inputs |
Task context, candidate inputs, and explicit acceptance criteria for action precondition checking. |
| Outputs |
A decision or artifact with recorded reasons, rejected alternatives, and verification evidence. |
| Safety |
Failures must fail closed and be reported with evidence rather than retried silently. |
Procedure
- Define the goal, the constraints, and the boundary of what this procedure may change.
- Inventory the available inputs and flag gaps or ambiguities that block progress.
- Execute the action precondition checking steps in a bounded, checkpointed way.
- Compare the actual outcome against the expected outcome and record deviations.
- On failure, apply the declared fallback path, and never widen permissions to recover.
- Emit a structured result with evidence and provenance for downstream consumers.
Runnable Example
# Action Precondition Checking: deterministic check
def validate(record, required):
missing = [k for k in required if k not in record]
return (True, []) if not missing else (False, missing)
ok, missing = validate({"id": "x", "source": "y"}, ["id", "source"])
assert ok and not missing
print("validated")
Failure Modes
- Acting outside the declared task boundary.
- Assuming an estimate or preview equals the verified effect.
- Retrying without preserving state or evidence.
- Using stale inputs as if they were current.
- Reporting success without checking the resulting state.
Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.
Evidence
Fail-closed pre-execution authorization is named in OWASP-style 2026 agentic guidance; precondition checks are a published requirement. These are dated public signals, not adoption metrics.
Related
- assertion.md
- quota-management.md
- permission-checking.md
1---2name: action-precondition-checking3description: Verify declared preconditions such as existence, permissions, quotas, and states before executing an action, and fail closed with reasons when one does not hold.4metadata:5 source: https://skillmd.com/skills/samotech/action-precondition-checking6 upstream: skills/04-action-execution/action-precondition-checking.md7 category: 04-action-execution8 version: "v1"9---1011# Action Precondition Checking1213## Description14Verify declared preconditions such as existence, permissions, quotas, and states before executing an action, and fail closed with reasons when one does not hold. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.1516## When to Use17- Multiple inputs or candidates compete and must be resolved by explicit criteria.18- A wrong intermediate result would propagate into consequential actions.19- The task repeats and benefits from a deterministic procedure.2021## Inputs / Outputs22| Area | Contract |23|---|---|24| Inputs | Task context, candidate inputs, and explicit acceptance criteria for action precondition checking. |25| Outputs | A decision or artifact with recorded reasons, rejected alternatives, and verification evidence. |26| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |2728## Procedure291. Define the goal, the constraints, and the boundary of what this procedure may change.302. Inventory the available inputs and flag gaps or ambiguities that block progress.313. Execute the action precondition checking steps in a bounded, checkpointed way.324. Compare the actual outcome against the expected outcome and record deviations.335. On failure, apply the declared fallback path, and never widen permissions to recover.346. Emit a structured result with evidence and provenance for downstream consumers.3536## Runnable Example37```python38# Action Precondition Checking: deterministic check39def validate(record, required):40 missing = [k for k in required if k not in record]41 return (True, []) if not missing else (False, missing)4243ok, missing = validate({"id": "x", "source": "y"}, ["id", "source"])44assert ok and not missing45print("validated")46```4748## Failure Modes49- Acting outside the declared task boundary.50- Assuming an estimate or preview equals the verified effect.51- Retrying without preserving state or evidence.52- Using stale inputs as if they were current.53- Reporting success without checking the resulting state.5455## Boundary56This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.5758## Evidence59Fail-closed pre-execution authorization is named in OWASP-style 2026 agentic guidance; precondition checks are a published requirement. These are dated public signals, not adoption metrics.6061## Related62- assertion.md63- quota-management.md64- permission-checking.md