Version 0.2 January 2026

Deploy Gate Profile

The Deploy Gate Profile is the first concrete HAP Profile, demonstrating how the protocol becomes enforceable in a real, high-risk domain: software deployment.


Profile Identity

FieldValue
Profile IDdeploy-gate
Profile Version0.2
DomainSoftware deployment
PurposePrevent unauthorized or drifted production deploys

Required Frame Keys

The Deploy Gate Profile defines a fixed canonical order for frame keys:

  1. repo
  2. sha
  3. env
  4. profile
  5. path
  6. disclosure_hash

Canonical Frame String

repo=<repo_slug>
sha=<commit_sha>
env=prod
profile=deploy-gate@0.2
path=<execution_path>
disclosure_hash=<sha256:...>

The frame hash is computed as:

frame_hash = sha256(frame_string)

Field Formats

To ensure deterministic hashing across implementations, all frame field values MUST conform to these formats:

FieldFormatExample
repo[a-z0-9_.-]+/[a-z0-9_.-]+ (lowercase, no leading/trailing slash)acme-corp/api-service
shaExactly 40 lowercase hexadecimal charactersa1b2c3d4e5f6... (40 chars)
envEnum: prod, stagingprod
profile<profile_id>@<version>deploy-gate@0.2
pathEnum from profile’s execution pathsdeploy-prod-canary
disclosure_hashsha256: + 64 lowercase hex characterssha256:a1b2c3... (71 chars total)

Validation rules:


Execution Paths and Approval Scopes

Execution Paths

PathDescription
deploy-prod-canaryCanary deployment to production
deploy-prod-fullFull production deployment

Required Decision Owner Scopes

deploy-prod-canary

At least one Decision Owner with:

deploy-prod-full

At least one Decision Owner with:

AND at least one Decision Owner with:


Disclosure

Disclosure represents what the human reviewed before approving.

Example Disclosure Object

{
  "repo": "org/service",
  "sha": "abc123",
  "changed_paths": ["infra/", "service/"],
  "risk_flags": ["db-migration"]
}

Disclosure Canonicalization

Set-typed fields

Fields representing unordered sets (where element order is not semantically meaningful) MUST be sorted lexicographically before serialization. Profiles MUST explicitly declare which fields are set-typed in their disclosure schema.

For this profile, the following fields are set-typed:

String and Path Normalization

To ensure consistent hashing:

Example canonicalization:

InputCanonical Form
./src/src
infra//configinfra/config
../outside(reject—escapes repo root)

The disclosure hash is computed as:

disclosure_hash = sha256(canonical_json_bytes)

The disclosure_hash MUST be included in the Frame.


Attestation Requirements

The Service Provider MUST verify:

The Service Provider MUST NOT issue attestations without verifying Decision Owner identity through an authenticated session (e.g., OAuth, WebAuthn). The specific authentication mechanism is implementation-defined.


Executor Proxy Rules

The Executor Proxy MUST:

Failure MUST abort execution.

Template Allowlist

For this profile, the following template_id values are permitted:

template_idAllowed Paths
deploy-prod-v1deploy-prod-canary, deploy-prod-full

The template_id MUST be included in the execution request payload. Requests with unknown or disallowed templates MUST be rejected.

Key Management

For demo/reference implementations, a single pinned SP public key is acceptable.

Production deployments SHOULD support keyset rotation:

TTL Policy

SettingValue
ttl_seconds_default1200 (20 minutes)
ttl_seconds_max3600 (60 minutes)

Error Responses

When validation fails, the Executor Proxy MUST reject the request and SHOULD return a structured error indicating the failure reason. Error responses MUST NOT leak sensitive information (e.g., expected hash values, internal state).

Recommended error codes:

CodeMeaning
INVALID_SIGNATUREAttestation signature verification failed
EXPIREDAttestation TTL exceeded
FRAME_MISMATCHRecomputed frame_hash does not match attestation
PATH_MISMATCHRequested execution path does not match attestation
SCOPE_INSUFFICIENTDecision Owner scopes do not satisfy path requirements
MALFORMED_ATTESTATIONAttestation structure is invalid

Security Guarantees

This profile guarantees:

It does not guarantee:

Known Limitations (v0.2)

Replay within TTL: A valid attestation can be replayed within its TTL window if an attacker obtains the attestation blob and bearer token. Mitigations:

v0.3 mitigation: One-time-use enforcement via attestation_id tracking. The Proxy will store used attestation IDs and reject subsequent uses with ALREADY_USED error.


Demo Wire Contract

For reference implementations, the attestation is embedded in PR comments:

---BEGIN HAP_ATTESTATION v=1---
profile=deploy-gate@0.2
env=prod
path=deploy-prod-canary
sha=<HEAD_SHA>
frame_hash=<sha256:...>
disclosure_hash=<sha256:...>
blob=<BASE64URL_ATTESTATION>
---END HAP_ATTESTATION---

Parsing Rules

To ensure consistent parsing across implementations:

RuleSpecification
Line endings\n only (LF, not CRLF)
Blob encodingBase64url without padding
Duplicate keysReject (parser MUST fail)
Multiple blocksReject (only one attestation block per comment)
Key formatkey=value with no whitespace around =
Block matchingFirst valid block in comment wins

Parsers MUST reject malformed blocks rather than attempting recovery.


Implementation Checklist

Service Provider

Executor Proxy

Local App

Next: Integration →