Documentation
¶
Index ¶
- Constants
- func CanonicalizeControlContainmentTelemetry(p *ControlContainmentTelemetryProfile) ([]byte, error)
- func ComputeHash(r *Record) (string, error)
- func Validate(r *Record) error
- func ValidateControlContainmentTelemetry(p *ControlContainmentTelemetryProfile) error
- func ValidateControlContainmentTelemetryProfile(p *ControlContainmentTelemetryProfile) error
- type AgentChainHop
- type AgentLineageHop
- type ControlContainmentTelemetry
- type ControlContainmentTelemetryProfile
- type ControlContainmentTelemetryRef
- type Controls
- type CorrelationRef
- type GuardrailStatus
- type HumanOversight
- type Integrity
- type PolicyRef
- type Record
- type RecordOpts
- type RedactionMetadata
- type Relations
- type Relationship
- type RelationshipEdge
- type RelationshipRef
Constants ¶
const ( ControlContainmentTelemetryProfileVersion = "1.0" BindingModeIdentifierOnly = "identifier_only" BindingModeDigestBound = "digest_bound" )
const ( ErrorCodeRelationshipRefIDRequired = "record.relationship_ref.id_required" ErrorCodeRelationshipRefKindInvalid = "record.relationship_ref.kind_invalid" ErrorCodeRelationshipRefDigestInvalid = "record.relationship_ref.digest_invalid" ErrorCodeRelationshipEdgeKindInvalid = "record.relationship_edge.kind_invalid" )
const SchemaVersion = "1.0"
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeControlContainmentTelemetry ¶ added in v0.6.0
func CanonicalizeControlContainmentTelemetry(p *ControlContainmentTelemetryProfile) ([]byte, error)
func ComputeHash ¶
func ValidateControlContainmentTelemetry ¶ added in v0.6.0
func ValidateControlContainmentTelemetry(p *ControlContainmentTelemetryProfile) error
func ValidateControlContainmentTelemetryProfile ¶ added in v0.6.0
func ValidateControlContainmentTelemetryProfile(p *ControlContainmentTelemetryProfile) error
Types ¶
type AgentChainHop ¶ added in v0.4.5
type AgentChainHop struct {
Identity string `json:"identity"`
Role string `json:"role"`
Extra map[string]json.RawMessage `json:"-"`
}
func (AgentChainHop) MarshalJSON ¶ added in v0.4.5
func (h AgentChainHop) MarshalJSON() ([]byte, error)
func (*AgentChainHop) UnmarshalJSON ¶ added in v0.4.5
func (h *AgentChainHop) UnmarshalJSON(data []byte) error
type AgentLineageHop ¶ added in v0.4.5
type AgentLineageHop struct {
AgentID string `json:"agent_id"`
DelegatedBy string `json:"delegated_by,omitempty"`
DelegationRecordID string `json:"delegation_record_id,omitempty"`
Extra map[string]json.RawMessage `json:"-"`
}
func (AgentLineageHop) MarshalJSON ¶ added in v0.4.5
func (h AgentLineageHop) MarshalJSON() ([]byte, error)
func (*AgentLineageHop) UnmarshalJSON ¶ added in v0.4.5
func (h *AgentLineageHop) UnmarshalJSON(data []byte) error
type ControlContainmentTelemetry ¶ added in v0.6.0
type ControlContainmentTelemetry = ControlContainmentTelemetryProfile
ControlContainmentTelemetry is a short alias for the public profile type.
type ControlContainmentTelemetryProfile ¶ added in v0.6.0
type ControlContainmentTelemetryProfile struct {
ProfileVersion string `json:"profile_version"`
EventRef *RelationshipRef `json:"event_ref,omitempty"`
ActionRef *RelationshipRef `json:"action_ref,omitempty"`
ContractRef *RelationshipRef `json:"contract_ref,omitempty"`
RunRef *RelationshipRef `json:"run_ref,omitempty"`
SessionRef *RelationshipRef `json:"session_ref,omitempty"`
PolicyRef *RelationshipRef `json:"policy_ref,omitempty"`
DecisionRef *RelationshipRef `json:"decision_ref,omitempty"`
ProofRef *RelationshipRef `json:"proof_ref,omitempty"`
CausalRef *RelationshipRef `json:"causal_ref,omitempty"`
ContainmentRef *RelationshipRef `json:"containment_ref,omitempty"`
BoundaryRef *RelationshipRef `json:"boundary_ref,omitempty"`
RevocationRef *RelationshipRef `json:"revocation_ref,omitempty"`
AcknowledgementRef *RelationshipRef `json:"acknowledgement_ref,omitempty"`
TraceID string `json:"trace_id,omitempty"`
SpanID string `json:"span_id,omitempty"`
ParentSpanID string `json:"parent_span_id,omitempty"`
ContentDigest string `json:"content_digest,omitempty"`
Redaction *RedactionMetadata `json:"redaction,omitempty"`
RedactionMetadata *RedactionMetadata `json:"redaction_metadata,omitempty"`
BindingMode string `json:"binding_mode"`
}
ControlContainmentTelemetryProfile is a product-neutral correlation envelope. It records references and telemetry identifiers without claiming that a product enforced a policy, contained an action, or authenticated a telemetry exporter.
func (*ControlContainmentTelemetryProfile) CanonicalJSON ¶ added in v0.6.0
func (p *ControlContainmentTelemetryProfile) CanonicalJSON() ([]byte, error)
CanonicalJSON validates and RFC 8785 canonicalizes the profile.
func (*ControlContainmentTelemetryProfile) Validate ¶ added in v0.6.0
func (p *ControlContainmentTelemetryProfile) Validate() error
Validate checks profile version, OpenTelemetry identifier shapes, digest syntax, and binding-mode semantics. Identifier-only mode intentionally carries no content binding: it proves only that identifiers were recorded.
type ControlContainmentTelemetryRef ¶ added in v0.6.0
type ControlContainmentTelemetryRef = RelationshipRef
ControlContainmentTelemetryRef reuses the digest-bound RelationshipRef contract so profile references remain interoperable with record relations.
type Controls ¶
type Controls struct {
PermissionsEnforced bool `json:"permissions_enforced"`
ApprovedScope string `json:"approved_scope,omitempty"`
WithinScope *bool `json:"within_scope,omitempty"`
GuardrailsActive []GuardrailStatus `json:"guardrails_active,omitempty"`
HumanOversight *HumanOversight `json:"human_oversight,omitempty"`
}
type CorrelationRef ¶ added in v0.6.0
type CorrelationRef = RelationshipRef
type GuardrailStatus ¶
type HumanOversight ¶
type PolicyRef ¶ added in v0.4.5
type PolicyRef struct {
PolicyID string `json:"policy_id,omitempty"`
PolicyVersion string `json:"policy_version,omitempty"`
PolicyDigest string `json:"policy_digest,omitempty"`
MatchedRuleIDs []string `json:"matched_rule_ids,omitempty"`
Extra map[string]json.RawMessage `json:"-"`
}
func (PolicyRef) MarshalJSON ¶ added in v0.4.5
func (*PolicyRef) UnmarshalJSON ¶ added in v0.4.5
type Record ¶
type Record struct {
RecordID string `json:"record_id"`
RecordVersion string `json:"record_version"`
Timestamp time.Time `json:"timestamp"`
Source string `json:"source"`
SourceProduct string `json:"source_product"`
AgentID string `json:"agent_id,omitempty"`
RecordType string `json:"record_type"`
Event map[string]any `json:"event"`
Controls Controls `json:"controls"`
Metadata map[string]any `json:"metadata,omitempty"`
Relationship *Relationship `json:"relationship,omitempty"`
// Deprecated: use relationship. Kept for backward compatibility.
Relations *Relations `json:"relations,omitempty"`
Integrity Integrity `json:"integrity"`
}
func New ¶
func New(opts RecordOpts) (*Record, error)
type RecordOpts ¶
type RecordOpts struct {
RecordVersion string
Timestamp time.Time
Source string
SourceProduct string
AgentID string
Type string
Event map[string]any
Controls Controls
Metadata map[string]any
Relationship *Relationship
// Deprecated: use Relationship. Kept for backward compatibility.
Relations *Relations
}
type RedactionMetadata ¶ added in v0.6.0
type Relations ¶ added in v0.4.5
type Relations = Relationship
type Relationship ¶ added in v0.4.5
type Relationship struct {
ParentRef *RelationshipRef `json:"parent_ref,omitempty"`
EntityRefs []RelationshipRef `json:"entity_refs,omitempty"`
PolicyRef *PolicyRef `json:"policy_ref,omitempty"`
AgentChain []AgentChainHop `json:"agent_chain,omitempty"`
Edges []RelationshipEdge `json:"edges,omitempty"`
// Legacy v1.x compatibility fields (accepted in both relationship and relations).
ParentRecordID string `json:"parent_record_id,omitempty"`
RelatedRecordIDs []string `json:"related_record_ids,omitempty"`
RelatedEntityIDs []string `json:"related_entity_ids,omitempty"`
AgentLineage []AgentLineageHop `json:"agent_lineage,omitempty"`
// Extra preserves additive fields so they remain hash/signature covered.
Extra map[string]json.RawMessage `json:"-"`
}
func (Relationship) MarshalJSON ¶ added in v0.4.5
func (r Relationship) MarshalJSON() ([]byte, error)
func (*Relationship) UnmarshalJSON ¶ added in v0.4.5
func (r *Relationship) UnmarshalJSON(data []byte) error
type RelationshipEdge ¶ added in v0.4.5
type RelationshipEdge struct {
Kind string `json:"kind"`
From RelationshipRef `json:"from"`
To RelationshipRef `json:"to"`
Extra map[string]json.RawMessage `json:"-"`
}
func (RelationshipEdge) MarshalJSON ¶ added in v0.4.5
func (e RelationshipEdge) MarshalJSON() ([]byte, error)
func (*RelationshipEdge) UnmarshalJSON ¶ added in v0.4.5
func (e *RelationshipEdge) UnmarshalJSON(data []byte) error
type RelationshipRef ¶ added in v0.4.5
type RelationshipRef struct {
Kind string `json:"kind"`
ID string `json:"id"`
Digest string `json:"digest,omitempty"`
SchemaID string `json:"schema_id,omitempty"`
SchemaVersion string `json:"schema_version,omitempty"`
SourceProduct string `json:"source_product,omitempty"`
Extra map[string]json.RawMessage `json:"-"`
}
func (RelationshipRef) MarshalJSON ¶ added in v0.4.5
func (r RelationshipRef) MarshalJSON() ([]byte, error)
func (*RelationshipRef) UnmarshalJSON ¶ added in v0.4.5
func (r *RelationshipRef) UnmarshalJSON(data []byte) error