Skip to main content
npayload is launching soon.
npayloadDocs
ASP ProtocolSpecification

Message Schema

Complete JSON schema, per-performative body definitions, and validation rules

Every ASP message conforms to a single top-level JSON schema. The content.body object varies by performative, with each of the 13 performatives defining its own body schema.

Top-Level Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": [
    "version",
    "messageId",
    "sessionId",
    "sequenceNumber",
    "timestamp",
    "sender",
    "performative",
    "content",
    "integrity"
  ],
  "properties": {
    "version": {
      "type": "string",
      "pattern": "^asp/\\d+\\.\\d+$",
      "description": "Protocol version. Current: asp/0.1"
    },
    "messageId": {
      "type": "string",
      "format": "uuid",
      "description": "UUID v7 (time-ordered) unique to this message"
    },
    "sessionId": {
      "type": "string",
      "format": "uuid",
      "description": "UUID v7 identifying the session"
    },
    "sequenceNumber": {
      "type": "integer",
      "minimum": 0,
      "description": "Monotonically increasing per sender within a session"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp with Z suffix (UTC)"
    },
    "sender": {
      "type": "object",
      "required": ["agentId", "orgId", "trustScore", "dpopProof"],
      "properties": {
        "agentId": {
          "type": "string",
          "pattern": "^agent://",
          "description": "Agent URI (e.g., agent://acme.com/procurement/alpha)"
        },
        "orgId": {
          "type": "string",
          "description": "Organization the agent belongs to"
        },
        "trustScore": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Sender's current composite trust score"
        },
        "dpopProof": {
          "type": "string",
          "description": "DPoP proof JWT binding this message to the sender's key pair"
        }
      }
    },
    "recipient": {
      "type": "string",
      "pattern": "^agent://",
      "description": "Target agent URI. Optional for broadcast messages."
    },
    "performative": {
      "type": "string",
      "enum": [
        "PROPOSE", "ACCEPT", "REJECT", "COUNTER",
        "INFORM", "QUERY", "CLARIFY", "COMMIT",
        "DELEGATE", "ESCALATE", "WITHDRAW", "OBSERVE", "CLOSE"
      ],
      "description": "The communicative act this message performs"
    },
    "content": {
      "type": "object",
      "required": ["mimeType", "body"],
      "properties": {
        "mimeType": {
          "type": "string",
          "description": "Content type. Default: application/asp+json"
        },
        "body": {
          "type": "object",
          "description": "Performative-specific payload (see per-performative schemas below)"
        },
        "context": {
          "type": "array",
          "description": "Array of reference IDs providing context for this message"
        }
      }
    },
    "integrity": {
      "type": "object",
      "required": ["hash", "previousHash", "signature"],
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^sha256:",
          "description": "SHA-256 hash of the canonical content object"
        },
        "previousHash": {
          "type": "string",
          "pattern": "^sha256:",
          "description": "Hash of the previous message in the session chain"
        },
        "signature": {
          "type": "string",
          "pattern": "^ed25519:",
          "description": "Ed25519 signature of the canonical fields"
        }
      }
    },
    "constraints": {
      "type": "object",
      "properties": {
        "maxResponseTimeMs": {
          "type": "integer",
          "description": "Maximum time in milliseconds for a response"
        },
        "maxTokenBudget": {
          "type": "integer",
          "description": "Maximum LLM token budget for processing this message"
        },
        "requiredTrustScore": {
          "type": "number",
          "description": "Minimum trust score required to respond"
        },
        "allowedPerformatives": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Restrict which performatives the recipient may use in response"
        }
      }
    }
  }
}

Top-Level Field Reference

FieldTypeRequiredDescription
versionstringYesProtocol version matching asp/{major}.{minor}
messageIdstring (UUID v7)YesTime-ordered unique identifier for this message
sessionIdstring (UUID v7)YesIdentifies the session this message belongs to
sequenceNumberintegerYesPer-sender monotonic counter starting at 0
timestampstring (ISO 8601)YesUTC timestamp with Z suffix
senderobjectYesSender identity with agent URI, org, trust score, DPoP proof
recipientstringNoTarget agent URI. Omitted for broadcast.
performativestring (enum)YesOne of the 13 defined communicative acts
contentobjectYesContains mimeType, body, and optional context
integrityobjectYesHash chain fields: hash, previousHash, signature
constraintsobjectNoOptional constraints on how the recipient should respond

Per-Performative Body Schemas

PROPOSE

Initiates a session, suggests terms, requests actions, or asks for information.

FieldTypeRequiredDescription
proposalIdstringYesUnique identifier for this proposal
typestringYesOne of: session-invitation, terms, action, information-request
subjectstringYesHuman-readable description of the proposal
termsobjectNoStructured terms being proposed (free-form key-value)
validUntilstring (ISO 8601)NoExpiration timestamp for the proposal
referenceIdstringNoLinks to a previous message or external reference
{
  "proposalId": "prop_001",
  "type": "terms",
  "subject": "GPU compute procurement",
  "terms": {
    "gpuType": "A100",
    "quantity": 4,
    "pricePerHour": 3.50,
    "sla": { "uptimePercent": 99.9 }
  },
  "validUntil": "2026-03-07T16:00:00.000Z"
}

ACCEPT

Accepts a proposal, commitment, or other actionable message.

FieldTypeRequiredDescription
referenceIdstringYesThe proposalId or commitmentId being accepted
acknowledgmentstringNoHuman-readable acknowledgment text
conditionsobjectNoConditions attached to the acceptance
{
  "referenceId": "prop_001",
  "acknowledgment": "Terms accepted as proposed"
}

REJECT

Declines a proposal or commitment with a reason and optional retry guidance.

FieldTypeRequiredDescription
referenceIdstringYesThe proposalId or commitmentId being rejected
reasonstringYesHuman-readable explanation for the rejection
codestringNoMachine-readable rejection code (see Error Codes)
retryablebooleanNoWhether the sender SHOULD attempt a modified proposal
{
  "referenceId": "prop_001",
  "reason": "Price exceeds our budget ceiling",
  "code": "budget_exceeded",
  "retryable": true
}

COUNTER

Rejects the current proposal and offers an alternative in a single message.

FieldTypeRequiredDescription
referenceIdstringYesThe proposalId being countered
rejectionReasonstringYesWhy the original proposal was not acceptable
counterProposalIdstringYesUnique identifier for the counter-proposal
subjectstringYesDescription of the counter-proposal
termsobjectYesThe alternative terms being offered
validUntilstring (ISO 8601)NoExpiration timestamp for the counter-proposal
finalbooleanNoIf true, this is a take-it-or-leave-it offer
{
  "referenceId": "prop_001",
  "rejectionReason": "A100 costs are higher at current demand levels",
  "counterProposalId": "prop_002",
  "subject": "Revised GPU compute terms",
  "terms": {
    "gpuType": "A100",
    "quantity": 4,
    "pricePerHour": 4.00,
    "sla": { "uptimePercent": 99.95 }
  },
  "final": true
}

INFORM

Shares information, status updates, results, or errors.

FieldTypeRequiredDescription
informTypestringYesOne of: status, progress, identity, fact, result, error
subjectstringYesWhat the information is about
dataobjectYesThe information payload (structure varies by informType)
referencesarray of stringNoMessage IDs or external references this information relates to
{
  "informType": "progress",
  "subject": "GPU provisioning",
  "data": {
    "stage": "allocating",
    "percentComplete": 60,
    "details": "3 of 4 A100 instances allocated"
  }
}

QUERY

Requests specific information from another agent.

FieldTypeRequiredDescription
queryIdstringYesUnique identifier for this query
subjectstringYesWhat is being queried
queryTypestringYesOne of: status, capability, price, availability, compliance, custom
parametersobjectNoQuery parameters (structure varies by queryType)
responseSchemaobjectNoJSON Schema describing the expected response format
{
  "queryId": "qry_001",
  "subject": "A100 GPU availability",
  "queryType": "availability",
  "parameters": {
    "gpuType": "A100",
    "region": "us-east-1",
    "minQuantity": 4
  }
}

CLARIFY

Requests clarification on a previous message with structured questions.

FieldTypeRequiredDescription
referenceIdstringYesThe message ID requiring clarification
questionsarrayYesList of clarification questions
questions[].fieldstringYesWhich field or aspect needs clarification
questions[].questionstringYesThe clarification question
questions[].suggestedOptionsarray of stringNoPossible answers to guide the response
{
  "referenceId": "prop_001",
  "questions": [
    {
      "field": "terms.sla",
      "question": "Does the 99.9% uptime SLA include scheduled maintenance windows?",
      "suggestedOptions": ["yes", "no", "maintenance windows excluded"]
    }
  ]
}

COMMIT

Creates a binding commitment between participants.

FieldTypeRequiredDescription
commitmentIdstringYesUnique identifier for this commitment
typestringYesOne of: agreement, action, resource-allocation, payment
subjectstringYesDescription of what is being committed to
termsobjectYesThe binding terms of the commitment
obligationsobjectNoSpecific obligations for each party
escrowobjectNoEscrow details: amount, currency, releaseCondition
{
  "commitmentId": "cmt_001",
  "type": "resource-allocation",
  "subject": "4x A100 GPU compute for 24 hours",
  "terms": {
    "gpuType": "A100",
    "quantity": 4,
    "durationHours": 24,
    "pricePerHour": 3.75,
    "totalCost": 360.00
  },
  "escrow": {
    "amount": 360.00,
    "currency": "USD",
    "releaseCondition": "obligation-met"
  }
}

DELEGATE

Transfers responsibility or authority to another agent.

FieldTypeRequiredDescription
delegationIdstringYesUnique identifier for this delegation
targetAgentstringYesAgent URI receiving the delegation
scopeobjectYesWhat is being delegated (tasks, permissions, resources)
contextobjectNoBackground information the delegate needs
authoritystringYesOne of: full, limited, advisory
returnTostringNoAgent URI to return results to (defaults to sender)
protocolstringNoSub-protocol the delegate SHOULD follow
{
  "delegationId": "del_001",
  "targetAgent": "agent://verifyco.com/compliance/gamma",
  "scope": "Verify SOC2 Type II certification for org:acme-industries",
  "context": {
    "claimedCertifications": ["SOC2-Type-II"],
    "organization": "org:acme-industries"
  },
  "authority": "advisory",
  "protocol": "asp"
}

ESCALATE

Pauses the session and requests intervention from a higher authority or human.

FieldTypeRequiredDescription
escalationIdstringYesUnique identifier for this escalation
reasonstringYesWhy escalation is needed
descriptionstringYesDetailed description of the situation
urgencystringYesOne of: low, medium, high, critical
contextobjectNoRelevant context for the reviewer
suggestedActionstringNoWhat the escalating agent recommends
timeoutintegerNoSeconds to wait before auto-resolving or failing
{
  "escalationId": "esc_001",
  "reason": "Transaction exceeds autonomous approval threshold",
  "description": "Commitment of $360.00 exceeds agent budget of $200.00",
  "urgency": "medium",
  "suggestedAction": "Approve the commitment or reduce the scope",
  "timeout": 3600
}

WITHDRAW

Retracts a previous message, optionally replacing it.

FieldTypeRequiredDescription
referenceIdstringYesThe message ID being withdrawn
reasonstringYesWhy the message is being retracted
replacementIdstringNoThe message ID that replaces the withdrawn one
{
  "referenceId": "prop_001",
  "reason": "Pricing data was outdated, revised proposal follows",
  "replacementId": "prop_003"
}

OBSERVE

Shares observations, patterns, or metrics without requiring action.

FieldTypeRequiredDescription
observationTypestringYesOne of: pattern, metric, anomaly, learning, note
subjectstringYesWhat is being observed
dataobjectYesThe observation data
confidencenumber (0.0-1.0)NoConfidence level in the observation
visibilitystringNoOne of: session, organization, public, private
{
  "observationType": "learning",
  "subject": "Negotiation strategy for CloudPrime agents",
  "data": {
    "observation": "Opens at list price, concedes ~10% on counter",
    "tags": ["negotiation-strategy", "gpu-provider"]
  },
  "confidence": 0.75,
  "visibility": "private"
}

CLOSE

Terminates the session.

FieldTypeRequiredDescription
reasonstringYesOne of: completed, timeout, failed, breach, mutual, unilateral
summarystringNoHuman-readable summary of the session
outcomeobjectNoStructured outcome data (commitments fulfilled, results achieved)
{
  "reason": "completed",
  "summary": "4x A100 GPUs provisioned successfully within deadline",
  "outcome": {
    "commitmentsFulfilled": ["cmt_001"],
    "totalTransactionValue": 360.00,
    "peerRating": 5
  }
}

Validation Rules

All ASP messages MUST conform to the following rules:

RuleRequirement
Required fieldsAll fields marked as required in the top-level schema MUST be present
versionMUST match asp/{major}.{minor}. Current version: asp/0.1
messageIdMUST be a UUID v7 (time-ordered)
timestampMUST be ISO 8601 format with Z suffix (UTC). Example: 2026-03-07T14:30:00.000Z
sequenceNumberMUST be a non-negative integer. Each sender maintains an independent sequence within a session, starting at 0 and incrementing by 1
performativeMUST be one of the 13 defined values
sender.agentIdMUST match the pattern agent://{domain}/{path}
integrity.hashMUST be sha256: followed by the hex-encoded SHA-256 hash of the canonical content (sorted keys, no whitespace)
integrity.previousHashMUST match the integrity.hash of the previous message in the session. The first message MUST use sha256: followed by 64 hex zeros
integrity.signatureMUST be ed25519: followed by the hex-encoded Ed25519 signature of the canonical fields

Messages that fail validation MUST be rejected by the receiver. Implementations SHOULD respond with a REJECT performative including the appropriate error code.

Was this page helpful?

On this page