schema

package
v0.3.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Disclaimer = "" /* 173-byte string literal not displayed */

Disclaimer is attached to every successful and error API response.

Variables

This section is empty.

Functions

func ParseDate

func ParseDate(s string) (time.Time, error)

ParseDate is a tiny helper so callers don't re-implement date formatting.

Types

type AffectedPopulation

type AffectedPopulation string
const (
	PopGeneralPublic     AffectedPopulation = "general_public"
	PopCustomers         AffectedPopulation = "customers"
	PopEmployees         AffectedPopulation = "employees"
	PopJobApplicants     AffectedPopulation = "job_applicants"
	PopStudents          AffectedPopulation = "students"
	PopPatients          AffectedPopulation = "patients"
	PopCreditConsumers   AffectedPopulation = "credit_consumers"
	PopSuspectsOrAccused AffectedPopulation = "suspects_or_accused"
	PopChildren          AffectedPopulation = "children"
	PopOther             AffectedPopulation = "other"
)

type AutonomyLevel

type AutonomyLevel string
const (
	AutonomyContentGeneration AutonomyLevel = "content_generation"
	AutonomyDecisionSupport   AutonomyLevel = "decision_support"
	AutonomyAutomatedDecision AutonomyLevel = "automated_decision"
	AutonomyAutonomousAction  AutonomyLevel = "autonomous_action"
)

type ClassifyRequest

type ClassifyRequest struct {
	Name               string             `json:"name,omitempty" yaml:"name,omitempty"`
	Purpose            string             `json:"purpose" yaml:"purpose"`
	DataTypes          []DataType         `json:"data_types" yaml:"data_types"`
	DeploymentContext  DeploymentContext  `json:"deployment_context" yaml:"deployment_context"`
	AutonomyLevel      AutonomyLevel      `json:"autonomy_level" yaml:"autonomy_level"`
	AffectedPopulation AffectedPopulation `json:"affected_population" yaml:"affected_population"`
	GeographicScope    GeographicScope    `json:"geographic_scope,omitempty" yaml:"geographic_scope,omitempty"`
	// Regimes selects which legal/policy packs to evaluate. Empty means the
	// engine/CLI/API default (typically ["eu-ai-act"]). Not the same as
	// geographic_scope — do not infer regimes from geography.
	Regimes                                []string `json:"regimes,omitempty" yaml:"regimes,omitempty"`
	UsesBiometricCategorisation            bool     `json:"uses_biometric_categorisation,omitempty" yaml:"uses_biometric_categorisation,omitempty"`
	RealTimeRemoteBiometricID              bool     `json:"real_time_remote_biometric_id,omitempty" yaml:"real_time_remote_biometric_id,omitempty"`
	SocialScoring                          bool     `json:"social_scoring,omitempty" yaml:"social_scoring,omitempty"`
	EmotionRecognitionWorkplaceOrEducation bool     `json:"emotion_recognition_workplace_or_education,omitempty" yaml:"emotion_recognition_workplace_or_education,omitempty"`
	ManipulativeTechniques                 bool     `json:"manipulative_techniques,omitempty" yaml:"manipulative_techniques,omitempty"`
	ExploitsVulnerabilities                bool     `json:"exploits_vulnerabilities,omitempty" yaml:"exploits_vulnerabilities,omitempty"`
}

ClassifyRequest is the public input shape for classification.

type ClassifyResponse

type ClassifyResponse struct {
	Name                string             `json:"name,omitempty"`
	RiskTier            RiskTier           `json:"risk_tier"`
	RulesetVersion      string             `json:"ruleset_version"`
	LastUpdated         string             `json:"last_updated"`
	MatchedRules        []MatchedRule      `json:"matched_rules"`
	Rationale           string             `json:"rationale"`
	RecommendedControls []string           `json:"recommended_controls"`
	TechnicalControls   []TechnicalControl `json:"technical_controls,omitempty"`
	JudgmentCalls       []string           `json:"judgment_calls,omitempty"`
	Disclaimer          string             `json:"disclaimer"`
	// MappingOnly mirrors the primary regime when it is a mapping pack.
	MappingOnly bool `json:"mapping_only,omitempty"`
	// Regime identifies which pack produced the top-level EU-compatible fields.
	// Omitted on the historical single-pack default path so golden JSON stays stable.
	Regime string `json:"regime,omitempty"`
	// Classifications is present when more than one regime was evaluated.
	// Single default eu-ai-act responses omit this for backward compatibility.
	Classifications []RegimeClassification `json:"classifications,omitempty"`
}

type DataType

type DataType string
const (
	DataPersonal             DataType = "personal_data"
	DataSpecialCategory      DataType = "special_category_data"
	DataBiometric            DataType = "biometric_data"
	DataEmployment           DataType = "employment_data"
	DataFinancialCredit      DataType = "financial_credit_data"
	DataEducation            DataType = "education_data"
	DataHealth               DataType = "health_data"
	DataLawEnforcement       DataType = "law_enforcement_data"
	DataPubliclyAvailable    DataType = "publicly_available"
	DataSyntheticNonPersonal DataType = "synthetic_or_non_personal"
	DataOther                DataType = "other"
)

type DeploymentContext

type DeploymentContext string
const (
	DeploySaaSB2B         DeploymentContext = "saas_b2b"
	DeploySaaSB2C         DeploymentContext = "saas_b2c"
	DeployOnPrem          DeploymentContext = "on_prem"
	DeployEmbedded        DeploymentContext = "embedded_product"
	DeployPublicAuthority DeploymentContext = "public_authority"
	DeployLawEnforcement  DeploymentContext = "law_enforcement"
	DeployInternalOnly    DeploymentContext = "internal_only"
	DeployOther           DeploymentContext = "other"
)

type ErrorResponse

type ErrorResponse struct {
	Error      string   `json:"error"`
	Details    []string `json:"details,omitempty"`
	Disclaimer string   `json:"disclaimer"`
}

type GeographicScope

type GeographicScope string
const (
	GeoEU          GeographicScope = "eu"
	GeoEUAndGlobal GeographicScope = "eu_and_global"
	GeoUS          GeographicScope = "us"
	GeoUSAndGlobal GeographicScope = "us_and_global"
	GeoNonEU       GeographicScope = "non_eu"
	GeoUnknown     GeographicScope = "unknown"
)

type MatchedRule

type MatchedRule struct {
	ID             string   `json:"id"`
	Tier           RiskTier `json:"tier"`
	ArticleOrAnnex string   `json:"article_or_annex"`
	Summary        string   `json:"summary"`
	RulesetVersion string   `json:"ruleset_version"`
	LastUpdated    string   `json:"last_updated"`
}

type RegimeClassification

type RegimeClassification struct {
	Regime              string             `json:"regime"`
	Character           string             `json:"character"`
	RiskTier            RiskTier           `json:"risk_tier"`
	RulesetVersion      string             `json:"ruleset_version"`
	LastUpdated         string             `json:"last_updated"`
	MatchedRules        []MatchedRule      `json:"matched_rules"`
	Rationale           string             `json:"rationale"`
	RecommendedControls []string           `json:"recommended_controls"`
	TechnicalControls   []TechnicalControl `json:"technical_controls,omitempty"`
	JudgmentCalls       []string           `json:"judgment_calls,omitempty"`
	// MappingOnly is true for mapping packs (e.g. nist-ai-rmf). risk_tier is
	// not a US legal conclusion — inspect matched_rules and technical_controls.
	MappingOnly bool `json:"mapping_only,omitempty"`
}

RegimeClassification is one pack's outcome. Kept separate from EU-shaped top-level fields so other jurisdictions are not forced into risk_tier enums.

type RiskTier

type RiskTier string
const (
	TierProhibited  RiskTier = "prohibited"
	TierHighRisk    RiskTier = "high_risk"
	TierLimitedRisk RiskTier = "limited_risk"
	TierMinimalRisk RiskTier = "minimal_risk"
)

type TechnicalControl

type TechnicalControl struct {
	ID            string `json:"id"`
	PaperRef      string `json:"paper_ref"`
	Summary       string `json:"summary"`
	TechnicalHook string `json:"technical_hook"`
	EvidenceType  string `json:"evidence_type"`
}

TechnicalControl links a paper/policy obligation to an implementable hook and the evidence artifact an auditor can re-run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL