Skip to content
Back to skills

Engagement Contract Validation

ASecurity

Validate versioned engagement, scenario, action plan, run result, and finding contracts and their lifecycle transitions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added October 15, 2026
securitypythonbashapisecurity

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 15, 2026

npx -y skills add sodejm/copilot-operation-plugin-for-security --skill engagement-contract-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Engagement Contract Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Engagement Contract Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sodejm-engagement-contract-validation/badge)](https://www.skillsdirectory.com/skills/sodejm-engagement-contract-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: engagement-contract-validation
description: Validate versioned engagement, scenario, action plan, run result, and finding contracts and their lifecycle transitions.
---

# Engagement contract validation

Validate and manage the integrity and lifecycle state transitions of COPS operational contracts:

- **Engagement** (`cops.engagement/v1`): Authorized assessment scope, rules of engagement, authorized time window, and operator identity.
- **Scenario** (`cops.scenario/v1`): Security assessment attack path mapped to MITRE ATT&CK techniques, environment requirements, and safety profiles.
- **ActionPlan** (`cops.action-plan/v1`): Immutable operation sequence bound to scenario and engagement with cryptographically verifiable `plan_digest`.
- **RunResult** (`cops.run-result/v1`): Execution outcome preserving truthfulness; non-success states (`partial`, `cancelled`, `failed`, `uncertain`, `not_assessed`) require explicit reasons and are never treated as false success.
- **Finding** (`cops.finding/v1`): Normalized security findings requiring linked evidence references for verified status.

## CLI Usage

### Validate a Contract File

To validate any operational contract against its schema and domain invariants:

```bash
python3 -m cops contract validate <path-to-contract.json>
```

You can optionally specify the expected type:

```bash
python3 -m cops contract validate <path-to-contract.json> --type engagement
```

Supported types: `engagement`, `scenario`, `action_plan`, `run_result`, `finding`.

### Validate a Lifecycle State Transition

To verify whether a lifecycle state transition is legally permitted:

```bash
python3 -m cops contract transition <current_state> <target_state> --type <engagement|action_plan>
```

#### Engagement Transitions
- Allowed:
  - `planned` -> `active`, `cancelled`
  - `active` -> `completed`, `cancelled`, `aborted`
- Terminal states: `completed`, `cancelled`, `aborted` (no further transitions permitted)

#### Action Plan Transitions
- Allowed:
  - `draft` -> `pending_approval`, `cancelled`
  - `pending_approval` -> `approved`, `rejected`, `cancelled`
  - `approved` -> `executing`, `cancelled`
  - `executing` -> `fulfilled`, `cancelled`
- Terminal states: `fulfilled`, `rejected`, `cancelled`

## Python API

```python
from cops.contracts import (
    Engagement,
    Scenario,
    ActionPlan,
    RunResult,
    Finding,
    validate_contract,
    validate_transition,
    evaluate_run_result,
)

# Validate a raw dictionary
validated_doc = validate_contract(data)

# Load into typed model and transition
engagement = Engagement.from_dict(data)
engagement.transition_to("active")

# Check execution outcome
result = RunResult.from_dict(result_data)
if not result.is_successful():
    print(f"Action did not succeed: {result.status} - {result.status_details['reason']}")
```

## Error Codes

- `malformed_identifier`: Identifier does not match required syntax prefix (`eng-`, `scen-`, `plan-`, `res-`, `find-`).
- `unsupported_version`: `schema_version` is missing or unrecognized.
- `illegal_transition`: Attempted state transition is disallowed by the lifecycle state machine.
- `integrity_mismatch`: Digest or cryptographic hash check failed (e.g. tampered action plan).
- `credential_leak_detected`: Plaintext secret or token detected in credential references.
- `invalid_timestamp`: Timestamp sequence violation (e.g. end time before start time).
- `missing_reason`: Non-success run result omitted mandatory explanation.
- `missing_evidence_reference`: Finding marked as `verified` without attached evidence records.

Files in this skill

  • SKILL.md3.5 KB
  • tests/test_skill.py1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.