🔒 VhyxSeal
GitHub

Schema Reference

The authoritative reference for all VhyxSeal types. Interfaces are exact copies from packages/core/src/schema/. Do not modify the schema without leadership approval — all changes must be logged in .claude/decisions.md.

ComponentContract

The core primitive. Describes what a component does, what an agent must verify before interacting, what changes after interaction, and how carefully the agent must proceed.

packages/core/src/schema/contract.ts
export interface ComponentContract {
  // IDENTITY
  id: string;
  type: ComponentType;
  intent: string;
  description: string;

  // PRECONDITIONS
  requires: readonly Condition[];
  requiredPermissions: readonly string[];

  // CONSEQUENCE
  consequence: string;
  affects: readonly string[];
  reversible: boolean;
  reversibleWindow?: number;

  // SAFETY
  safetyLevel: SafetyLevel;
  requiresConfirmation: boolean;
  destructive: boolean;

  // AGENT NAVIGATION HINTS
  alternatives?: readonly string[];
  nextExpected?: readonly string[];
  errorStates?: readonly ErrorState[];

  // CONTRACT METADATA
  contractVersion: string;
  fingerprint?: string;
  lastVerified?: string;
  verifiedBy?: "auto" | "manual" | "test";
  changelog?: readonly ContractChangelog[];
}
FieldTypeRequiredDescription
idstringrequiredUnique identifier for this component on the page
typeComponentTyperequiredCategory of component — how agents interpret it
intentstringrequiredMachine-readable intent e.g. place-order
descriptionstringrequiredHuman-readable explanation for agent reasoning
requiresCondition[]requiredPreconditions that must all be satisfied
requiredPermissionsstring[]requiredPermission scopes required
consequencestringrequiredPlain description of what changes after interaction
affectsstring[]requiredSystem areas affected e.g. [cart, orders]
reversiblebooleanrequiredWhether the action can be undone
reversibleWindownumberoptionalSeconds within which undo is possible
safetyLevelSafetyLevelrequiredHow carefully the agent must proceed
requiresConfirmationbooleanrequiredAgent must obtain human approval first
destructivebooleanrequiredPermanently deletes or modifies data
alternativesstring[]optionalOther component ids with similar function
nextExpectedstring[]optionalComponent ids typically following this one
errorStatesErrorState[]optionalKnown failure modes and recovery paths
contractVersionstringrequiredDeveloper-managed semver e.g. 1.0.0
fingerprintstringoptionalAuto-generated — hash of contract content
lastVerifiedstringoptionalISO date — when contract was last confirmed
verifiedByauto | manual | testoptionalHow the contract was verified
changelogContractChangelog[]optionalHistory of changes to this contract
import { defineContract } from '@vhyxseal/core'

const checkoutContract = defineContract({
  id: "checkout-submit-btn",
  type: "action",
  intent: "place-order",
  description: "Submits the cart as a purchase order",
  requires: [
    { field: "user.authenticated", operator: "===", value: true, description: "User must be logged in" },
    { field: "cart.hasItems", operator: "===", value: true, description: "Cart must have items" },
  ],
  requiredPermissions: ["write:orders"],
  consequence: "Creates order, charges payment, triggers fulfillment",
  affects: ["cart", "orders", "payment"],
  reversible: true,
  reversibleWindow: 300,
  safetyLevel: "high",
  requiresConfirmation: true,
  destructive: false,
  contractVersion: "1.0.0",
})

Condition

A precondition that must be satisfied before an agent interacts. Always use abstract field references — never expose internal data structure or database field names.

packages/core/src/schema/contract.ts
export interface Condition {
  /** Abstract field reference — never expose internals e.g. "user.hasPaymentMethod" */
  field: string;
  operator: "===" | "!==" | ">" | "<" | ">=" | "<=" | "includes" | "excludes";
  value: unknown;
  description: string;
}
FieldTypeRequiredDescription
fieldstringrequiredAbstract reference e.g. user.hasPaymentMethod — never internal DB field names
operator=== | !== | > | < | >= | <= | includes | excludesrequiredComparison operator
valueunknownrequiredThe value to compare against
descriptionstringrequiredHuman-readable e.g. User must have a payment method saved

ErrorState

A known failure mode for a component and how an agent should recover. Include every failure mode that an agent might encounter.

packages/core/src/schema/contract.ts
export interface ErrorState {
  /** What causes this error e.g. "payment declined" */
  trigger: string;
  /** What the UI shows e.g. "red banner with payment failed message" */
  display: string;
  /** What the agent should do e.g. "navigate to update-payment-method" */
  recovery: string;
}
FieldTypeDescription
triggerstringWhat causes this error e.g. payment declined
displaystringWhat the UI shows e.g. red banner with payment failed message
recoverystringWhat the agent should do e.g. navigate to update-payment-method

ComponentType

The five categories of UI component. Determines how agents interpret and interact with a component.

packages/core/src/schema/contract.ts
export type ComponentType =
  | "action"        // buttons, triggers — does something
  | "input"         // forms, search, filters — collects data
  | "navigation"    // links, menus, tabs — moves somewhere
  | "display"       // shows current state — read only
  | "confirmation"; // gates a decision — dialogs, modals
ValueUse when
actionButtons, triggers — the component causes something to happen
inputForms, search fields, filters — the component collects data
navigationLinks, menus, tabs — the component moves to another location
displayRead-only content showing current state — agent reads, does not act
confirmationModals, dialogs — the component gates a decision

SafetyLevel

Controls how carefully an agent must proceed. Higher levels require explicit human confirmation. When in doubt, choose the higher level.

packages/core/src/schema/contract.ts
export type SafetyLevel =
  | "low"       // read, filter, sort — agent proceeds freely
  | "medium"    // send message, save draft — proceed with care
  | "high"      // place order, submit form — confirm with human
  | "critical"  // delete account, payment — always require human
  | "sensitive"; // medical, financial data — extra protections apply
ValueConfirmationExamples
lowNot requiredSearch, filter, sort, navigate, sign-out
mediumNot requiredSend message, save draft, update profile, upload file
highRequiredPlace order, submit form, publish content, cancel booking
criticalAlways requiredDelete account, make payment, irreversible data changes
sensitiveRequiredMedical data, financial information, passwords

Relationship Types

Three relationship types cover all component interactions. Use relationships to describe flows that span multiple components.

CompositionRelationship

Components that belong together structurally. Used when a parent requires specific children to be valid before it can act.

packages/core/src/schema/relationships.ts
export interface CompositionRelationship {
  type: "composition";
  id: string;
  parent: string;
  children: readonly string[];
  completionRequires: readonly string[];
  description: string;
}

SequenceRelationship

Components with a defined order. Used for multi-step flows like checkout or onboarding where the agent must follow steps in sequence.

packages/core/src/schema/relationships.ts
export interface SequenceStep {
  order: number;
  componentId: string;
  canSkip: boolean;
  skipCondition?: string;
  onComplete: string;
  onFail: string;
}

export interface SequenceRelationship {
  type: "sequence";
  id: string;
  description: string;
  steps: readonly SequenceStep[];
  linear: boolean;
}

DependencyRelationship

One component's state gates another's behavior. Used when filling an input enables a button, or selecting a plan shows additional fields.

packages/core/src/schema/relationships.ts
export type DependencyEffect =
  | "enables" | "disables" | "shows" | "hides" | "modifies";

export interface DependencyRelationship {
  type: "dependency";
  id: string;
  source: string;
  target: string;
  condition: Condition;
  effect: DependencyEffect;
  description: string;
}

Capability

The highest level of abstraction. Agents think in capabilities — not individual components. A capability groups all relationships and components needed to accomplish a user-facing goal.

packages/core/src/schema/capability.ts
export interface Capability {
  id: string;
  description: string;
  entryPoint: string;
  exitPoints: readonly ExitPoint[];
  relationships: readonly CapabilityRelationshipRef[];
  estimatedSteps: number;
  requiresAuth: boolean;
  safetyLevel: SafetyLevel;
  spanPages?: readonly string[];
}
FieldTypeRequiredDescription
idstringrequiredUnique capability identifier e.g. purchase-item
descriptionstringrequiredHuman and agent readable description
entryPointstringrequiredComponent id where the capability starts
exitPointsExitPoint[]requiredAll possible end states (success, failure, cancelled)
relationshipsCapabilityRelationshipRef[]requiredRelationships that make up this capability
estimatedStepsnumberrequiredApproximate step count — helps agent plan
requiresAuthbooleanrequiredUser must be authenticated
safetyLevelSafetyLevelrequiredHighest safety level in the capability chain
spanPagesstring[]optionalRoutes this capability spans across multiple pages
import { defineCapability } from '@vhyxseal/core'

const purchaseCapability = defineCapability({
  id: "purchase-item",
  description: "Browse, select, and purchase a product",
  entryPoint: "product-add-to-cart-btn",
  exitPoints: [
    { componentId: "order-confirmation-display", outcome: "success", description: "Order placed" },
    { componentId: "payment-error-display", outcome: "failure", description: "Payment failed" },
  ],
  relationships: [],
  estimatedSteps: 4,
  requiresAuth: true,
  safetyLevel: "high",
})

VhyxSealManifest

The complete manifest served at /__agent__/manifest.json. Auto-generated — never hand-written. Contains all contracts, relationships, capabilities, and the site's agent access policy.

packages/core/src/manifest/types.ts
export interface VhyxSealManifest {
  // Schema identification
  vhyxseal: string;          // schema version e.g. "1.0.0"
  schemaUrl: string;

  // Site identification
  domain: string;
  domainVerified: boolean;
  verificationToken: string;

  // Integrity
  signature: string;         // HMAC-SHA256 or "unsigned" (stub)
  signedAt: string;
  fingerprint: string;

  // Content
  capabilities: readonly Capability[];
  components: readonly ComponentContract[];
  relationships: readonly Relationship[];

  // Policy
  agentPolicy: AgentPolicy;

  // Cache and freshness
  generatedAt: string;       // ISO datetime
  expiresAt: string;
}
// GET /__agent__/manifest.json
{
  "vhyxseal": "1.0.0",
  "domain": "example.com",
  "domainVerified": true,
  "signature": "unsigned",
  "fingerprint": "vhyxs_a3f8b2c1",
  "components": [...],
  "relationships": [],
  "capabilities": [...],
  "agentPolicy": {
    "allowedAgents": ["*"],
    "blockedAgents": [],
    "allowedActions": ["*"],
    "blockedActions": [],
    "requiresConfirmation": ["place-order", "delete-account"],
    "rateLimits": {
      "actionsPerMinute": 60,
      "actionsPerHour": 500,
      "manifestRequestsPerMinute": 10,
      "perAgentSession": true
    }
  },
  "generatedAt": "2026-05-27T10:00:00.000Z",
  "expiresAt": "2026-05-27T11:00:00.000Z"
}

AgentPolicy

Access policy controlling which agents may act on a site. Site owners set this in SealProvider config. The default policy allows all agents with reasonable rate limits.

packages/core/src/manifest/types.ts
export interface AgentPolicy {
  allowedAgents: readonly string[];          // ["*"] for all
  blockedAgents: readonly string[];
  requireAgentIdentification: boolean;
  rateLimits: RateLimits;
  allowedActions: readonly string[];         // intent ids; ["*"] for all
  blockedActions: readonly string[];
  requiresConfirmation: readonly string[];   // intent ids
  requiresHumanPresent: readonly string[];   // intent ids
  manifestAccess: "public" | "private";
  manifestAuth?: "bearer-token";             // only when manifestAccess is "private"
}
FieldDefaultDescription
allowedAgents["*"]Use specific agent identifiers to restrict access
blockedAgents[]Patterns to explicitly block
requireAgentIdentificationfalseAgents must identify before acting
allowedActions["*"]Restrict to specific intent ids
blockedActions[]Explicitly blocked intent ids
requiresConfirmation[]Intent ids always needing human confirmation
requiresHumanPresent[]Intent ids needing verified human in loop
manifestAccess"public"Set to private to require bearer token

RateLimits

Per-agent rate limits. Configured within AgentPolicy.rateLimits. Rate limit enforcement is schema-defined but not yet enforced by VhyxSeal middleware in 1.0.0-rc — see the Security guide for details.

packages/core/src/manifest/types.ts
export interface RateLimits {
  actionsPerMinute: number;
  actionsPerHour: number;
  manifestRequestsPerMinute: number;
  perAgentSession: boolean;
}
FieldDefaultDescription
actionsPerMinute60Maximum agent actions per minute
actionsPerHour500Maximum agent actions per hour
manifestRequestsPerMinute10Maximum manifest fetches per minute
perAgentSessiontrueApply limits per agent session (true) or globally (false)