Module adcp.types.domains.governance

Types the AdCP governance schemas declare.

Importing from the domain says which variant you mean, where the flat adcp.types namespace can only bind one class per name:

from adcp.types.domains.governance import <Type>

A type this domain declares in more than one schema is not here: import it from its own schema's module, adcp.types.domains.governance.<schema>. Nothing here is renamed.

Auto-generated from the generated domain tree. DO NOT EDIT MANUALLY. Generation date: 2026-10-04 18:45:11 UTC

Sub-modules

adcp.types.domains.governance.accepted_governance_agents
adcp.types.domains.governance.attribute_definition
adcp.types.domains.governance.audience_constraints
adcp.types.domains.governance.check_governance_request
adcp.types.domains.governance.check_governance_response
adcp.types.domains.governance.get_plan_audit_logs_request
adcp.types.domains.governance.get_plan_audit_logs_response
adcp.types.domains.governance.policy_category_definition
adcp.types.domains.governance.policy_entry
adcp.types.domains.governance.policy_ref
adcp.types.domains.governance.report_plan_adjustment_request
adcp.types.domains.governance.report_plan_adjustment_response
adcp.types.domains.governance.report_plan_outcome_request
adcp.types.domains.governance.report_plan_outcome_response
adcp.types.domains.governance.reported_outcome_error
adcp.types.domains.governance.sync_plans_request
adcp.types.domains.governance.sync_plans_response

Classes

class AcceptedGovernanceAgents (**data: Any)
Expand source code
class AcceptedGovernanceAgents(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    any_of: Annotated[list[AnyOf], Field(min_length=1)]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var any_of : list[AnyOf]
var model_config

Inherited members

class Action (*args, **kwds)
Expand source code
class Action(StrEnum):
    report = 'report'
    review = 'review'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var report
var review
class ActionBinding (**data: Any)
Expand source code
class ActionBinding(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    action_type: Annotated[
        Literal['https://adcontextprotocol.org/actions/governance-check'],
        Field(
            description='Absolute URI naming the action vocabulary, such as an AdCP governance-check or audience-evidence snapshot type.'
        ),
    ] = 'https://adcontextprotocol.org/actions/governance-check'
    action_id: Annotated[
        str,
        Field(
            description="Stable identifier of the consuming action within the domain consumer's namespace.",
            max_length=1024,
            min_length=1,
        ),
    ]
    action_digest: Annotated[
        str | None,
        Field(
            description='SHA-256 digest of the domain-defined canonical action preimage.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var action_digest : str | None
var action_id : str
var action_type : Literal['https://adcontextprotocol.org/actions/governance-check']
var model_config

Inherited members

class Allocations (**data: Any)
Expand source code
class Allocations(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    amount: Annotated[
        StrictFloat | None, Field(description='Maximum budget for this purchase type.', ge=0.0)
    ] = None
    max_pct: Annotated[
        StrictFloat | None,
        Field(
            description='Maximum percentage of total budget for this purchase type.',
            ge=0.0,
            le=100.0,
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var amount : float | None
var max_pct : float | None
var model_config

Inherited members

class AnyOf (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class AnyOf(RootModel[AnyOf1 | AnyOf2]):
    root: Annotated[AnyOf1 | AnyOf2, Field(discriminator='kind')]
    def __getattr__(self, name: str) -> Any:
        """Proxy attribute access to the wrapped type."""
        if name.startswith('_'):
            raise AttributeError(name)
        return getattr(self.root, name)

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[Union[AnyOf1, AnyOf2]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : AnyOf1 | AnyOf2
class AnyOf1 (**data: Any)
Expand source code
class AnyOf1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    kind: Literal['agent_url'] = 'agent_url'
    agent_url: Annotated[
        AnyUrl,
        Field(
            description='Exact canonical agent endpoint without userinfo, query, or fragment. Redirect targets, DNS aliases, and URLs asserted by the candidate do not satisfy this matcher.'
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var agent_url : pydantic.networks.AnyUrl
var kind : Literal['agent_url']
var model_config

Inherited members

class AnyOf2 (**data: Any)
Expand source code
class AnyOf2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    kind: Literal['verification'] = 'verification'
    registry: Annotated[
        AnyUrl,
        Field(
            description='Seller-configured trusted verification registry without userinfo, query, or fragment. The candidate cannot supply or override this URL; fetches use the registry-resolution security contract.'
        ),
    ]
    role: Annotated[
        str,
        Field(
            description="Role asserted by the trusted registry's verified record, never by candidate self-description.",
            pattern='^[a-z][a-z0-9_-]*$',
        ),
    ]
    adcp_version: Annotated[
        str,
        Field(
            description='Registry protocol version in canonical MAJOR.MINOR form.',
            pattern='^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$',
        ),
    ]
    verification_modes: Annotated[list[VerificationMode], Field(min_length=1)]
    max_age_seconds: Annotated[
        SchemaInt,
        Field(
            description='Maximum age of the registry evidence at binding time. Zero requires a fresh result. Evidence is pinned to the accepted binding; later registry drift does not silently revoke an existing binding.',
            ge=0,
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var adcp_version : str
var kind : Literal['verification']
var max_age_seconds : int
var model_config
var registry : pydantic.networks.AnyUrl
var role : str
var verification_modes : list[VerificationMode]

Inherited members

class AttributeDefinition (**data: Any)
Expand source code
class AttributeDefinition(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    attribute_id: Annotated[
        str,
        Field(
            description='Unique identifier for this attribute. Used in plan.restricted_attributes, signal-definition.restricted_attributes, and data marketplace catalog entries.',
            pattern='^[a-z][a-z0-9_]*$',
        ),
    ]
    name: Annotated[str, Field(description="Human-readable name (e.g., 'Health Data').")]
    description: Annotated[
        str,
        Field(
            description='What this attribute category covers. Defines the boundary — what is and is not included.'
        ),
    ]
    regulatory_basis: Annotated[
        list[RegulatoryBasi] | None,
        Field(description='Regulations that define or restrict this attribute category.'),
    ] = None
    includes: Annotated[
        list[str] | None,
        Field(
            description="Specific data types that fall within this category (e.g., for health_data: 'medical conditions', 'disability status', 'prescription history', 'inferred health from behavioral signals')."
        ),
    ] = None
    excludes: Annotated[
        list[str] | None,
        Field(
            description='Data types that might seem related but are explicitly outside this category. Helps with boundary cases.'
        ),
    ] = None
    signal_patterns: Annotated[
        list[str] | None,
        Field(
            description="Common signal naming or tagging patterns that indicate this attribute (e.g., 'health:', 'condition_', 'diagnosis_'). Data providers and governance agents use these as hints when signals lack explicit restricted_attributes declarations."
        ),
    ] = None
    guidance: Annotated[
        str | None,
        Field(
            description='Implementation notes. Covers edge cases, inferred vs. declared data, and common pitfalls.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var attribute_id : str
var description : str
var excludes : list[str] | None
var guidance : str | None
var includes : list[str] | None
var model_config
var name : str
var regulatory_basis : list[RegulatoryBasi] | None
var signal_patterns : list[str] | None

Inherited members

class AudienceConstraints (**data: Any)
Expand source code
class AudienceConstraints(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    include: Annotated[
        list[audience_selector.AudienceSelector] | None,
        Field(
            description="Desired audience criteria. The seller's targeting should align with these. Each criterion is evaluated independently — the combined targeting should satisfy at least one inclusion criterion.",
            min_length=1,
        ),
    ] = None
    exclude: Annotated[
        list[audience_selector.AudienceSelector] | None,
        Field(
            description="Excluded audience criteria. The seller's targeting must not overlap with these. Exclusions take precedence over inclusions. Used for protected groups, vulnerable communities, regulatory restrictions, or brand safety.",
            min_length=1,
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var exclude : list[AudienceSelector1 | AudienceSelector2 | AudienceSelector3 | AudienceSelector4] | None
var include : list[AudienceSelector1 | AudienceSelector2 | AudienceSelector3 | AudienceSelector4] | None
var model_config

Inherited members

class AudienceDistribution (**data: Any)
Expand source code
class AudienceDistribution(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    baseline: Annotated[
        Baseline,
        Field(
            description="Population baseline used for index calculation. 'census': national census or equivalent population data. 'platform': the seller's active user base. 'custom': a custom baseline defined by the seller (describe in baseline_description)."
        ),
    ]
    baseline_description: Annotated[
        str | None,
        Field(
            description="Description of the baseline when baseline is 'custom' (e.g., 'US adults 18+ with broadband access')."
        ),
    ] = None
    indices: Annotated[
        dict[Annotated[str, StringConstraints(pattern=r'^[a-z_]+:.+$')], StrictFloat],
        Field(
            description="Audience index values for the current reporting period. Keys are seller-defined dimension:value strings (e.g., 'age:25-34', 'gender:female', 'income:high'). The protocol does not mandate a taxonomy — dimensions and value labels vary by seller. Values are index relative to the declared baseline (1.0 = at parity, >1.0 = over-indexed, <1.0 = under-indexed)."
        ),
    ]
    cumulative_indices: Annotated[
        dict[Annotated[str, StringConstraints(pattern=r'^[a-z_]+:.+$')], StrictFloat] | None,
        Field(
            description='Cumulative audience index values since the governed action started. Same key format as indices (dimension:value). Use for detecting sustained bias drift that may not appear in a single reporting period.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var baseline : Baseline
var baseline_description : str | None
var cumulative_indices : dict[str, float] | None
var indices : dict[str, float]
var model_config

Inherited members

class AudienceDistribution1 (**data: Any)
Expand source code
class AudienceDistribution1(AudienceDistribution):
    pass

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config

Inherited members

class Baseline (*args, **kwds)
Expand source code
class Baseline(StrEnum):
    census = 'census'
    platform = 'platform'
    custom = 'custom'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var census
var custom
var platform
class BoundedObject (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class BoundedObject(RootModel[dict[Annotated[str, StringConstraints(max_length=128)], BoundedValue]]):
    root: Annotated[dict[Annotated[str, StringConstraints(max_length=128)], BoundedValue], Field(max_length=32)]

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[dict[Annotated[str, StringConstraints], Union[BoundedScalar, BoundedValue1, dict[str, Union[BoundedScalar, BoundedValueLevel21, dict[str, Union[BoundedScalar, BoundedValueLevel31, dict[str, Union[BoundedScalar, NoneType]], NoneType]], NoneType]], NoneType]]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : dict[str, BoundedScalar | BoundedValue1 | dict[str, BoundedScalar | BoundedValueLevel21 | dict[str, BoundedScalar | BoundedValueLevel31 | dict[str, BoundedScalar | None] | None] | None] | None]
class BoundedScalar (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class BoundedScalar(RootModel[StrictBool | StrictFloat | BoundedScalar1 | None]):
    root: StrictBool | StrictFloat | BoundedScalar1 | None
    def __getattr__(self, name: str) -> Any:
        """Proxy attribute access to the wrapped type."""
        if name.startswith('_'):
            raise AttributeError(name)
        return getattr(self.root, name)

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[Union[Annotated[bool, Strict(strict=True)], Annotated[float, Strict(strict=True)], BoundedScalar1, NoneType]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : bool | float | BoundedScalar1 | None
class BoundedScalar1 (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class BoundedScalar1(ScalarStr):
    __slots__ = ()
    _constraints = {'max_length': 4000}

A str generated from a JSON Schema string root.

Ancestors

  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str
class BoundedValue1 (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class BoundedValue1(RootModel[list[BoundedValueLevel2]]):
    root: Annotated[list[BoundedValueLevel2], Field(max_length=32)]

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[list[Union[BoundedScalar, BoundedValueLevel21, dict[str, Union[BoundedScalar, BoundedValueLevel31, dict[str, Union[BoundedScalar, NoneType]], NoneType]], NoneType]]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : list[BoundedScalar | BoundedValueLevel21 | dict[str, BoundedScalar | BoundedValueLevel31 | dict[str, BoundedScalar | None] | None] | None]
class BoundedValueLevel21 (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class BoundedValueLevel21(RootModel[list[BoundedValueLevel3]]):
    root: Annotated[list[BoundedValueLevel3], Field(max_length=32)]

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[list[Union[BoundedScalar, BoundedValueLevel31, dict[str, Union[BoundedScalar, NoneType]], NoneType]]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : list[BoundedScalar | BoundedValueLevel31 | dict[str, BoundedScalar | None] | None]
class BoundedValueLevel31 (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class BoundedValueLevel31(RootModel[list[BoundedScalar | None]]):
    root: Annotated[list[BoundedScalar | None], Field(max_length=32)]
    def __getattr__(self, name: str) -> Any:
        """Proxy attribute access to the wrapped type."""
        if name.startswith('_'):
            raise AttributeError(name)
        return getattr(self.root, name)

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes
-----=
root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • pydantic.root_model.RootModel[list[Union[BoundedScalar, NoneType]]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var root : list[BoundedScalar | None]
class Budget2 (**data: Any)
Expand source code
class Budget2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    total: Annotated[StrictFloat, Field(description='Total authorized budget.')]
    currency: Annotated[str, Field(description='ISO 4217 currency code.')]
    accounting_mode: Annotated[
        AccountingMode | None,
        Field(
            description='Controls which verified adjustments restore reusable plan headroom. gross_commitment allows verified decommitments only; verified_net_cost also allows buyer-accepted refunds and credits. Both modes retain the original commitment in anti-fragmentation history and expose economic net cost separately.'
        ),
    ] = AccountingMode.gross_commitment
    per_seller_max_pct: Annotated[
        StrictFloat | None,
        Field(description='Maximum percentage of budget that can go to a single seller.'),
    ] = None
    reallocation_threshold: Annotated[
        StrictFloat | None,
        Field(
            description='Amount above which budget reallocations require human escalation. The orchestrator can reallocate spend across sellers, channels, or purchase types up to this threshold per change without asking a human. Set equal to `total` for effectively unlimited reallocation; set to 0 to require approval for every reallocation. Separate from `plan.human_review_required`, which governs decisions affecting data subjects (targeting, creative, delivery) under GDPR Art 22 / EU AI Act Annex III. Denominated in `budget.currency`.',
            ge=0.0,
        ),
    ] = None
    reallocation_unlimited: Annotated[
        Literal[True],
        Field(
            description='Set to true to allow the orchestrator to reallocate without any limit up to `total`. Mutually exclusive with `reallocation_threshold`. Use this for deliberate full-autonomy declarations rather than setting `reallocation_threshold: total` (which silently tightens when `total` changes).'
        ),
    ]
    allocations: Annotated[
        dict[purchase_type.PurchaseType, Allocations] | None,
        Field(
            description='Optional budget partition across purchase types. Keys are purchase-type enum values (media_buy, rights_license, signal_activation, creative_services). When present, the governance agent validates spend against both the total and the per-type allocation. When absent, all spend counts against the single total regardless of purchase type.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var accounting_mode : AccountingMode | None
var allocations : dict[PurchaseType, Allocations] | None
var currency : str
var model_config
var per_seller_max_pct : float | None
var reallocation_threshold : float | None
var reallocation_unlimited : Literal[True]
var total : float

Inherited members

class BudgetLimit (**data: Any)
Expand source code
class BudgetLimit(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    amount: StrictFloat
    currency: str

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var amount : float
var currency : str
var model_config

Inherited members

class Category (**data: Any)
Expand source code
class Category(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    category_id: Annotated[str, Field(description='Validation category identifier.')]
    status: Annotated[Status51, Field(description='Whether this category is active for this plan.')]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var category_id : str
var model_config
var status : Status51

Inherited members

class ChannelAllocation (**data: Any)
Expand source code
class ChannelAllocation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    committed: Annotated[
        StrictFloat | None, Field(description='Budget committed to this channel.')
    ] = None
    pct: Annotated[
        StrictFloat | None, Field(description="Channel's share of the authorized total budget.")
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var committed : float | None
var model_config
var pct : float | None

Inherited members

class Channels (**data: Any)
Expand source code
class Channels(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    required: Annotated[
        list[channels_1.MediaChannel] | None,
        Field(description='Channels that must be included in the media mix.'),
    ] = None
    allowed: Annotated[
        list[channels_1.MediaChannel] | None,
        Field(description='Channels the orchestrator may use.'),
    ] = None
    mix_targets: Annotated[
        dict[str, MixTargets] | None,
        Field(description='Target allocation ranges per channel, keyed by channel ID.'),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var allowed : list[MediaChannel] | None
var mix_targets : dict[str, MixTargets] | None
var model_config
var required : list[MediaChannel] | None

Inherited members

class CheckGovernanceRequest (**data: Any)
Expand source code
class CheckGovernanceRequest(AdcpRequest, CheckGovernanceRequest3):
    'Universal governance check for campaign actions. The governance agent infers the check type from the fields present: tool+payload = intent check (proposed, orchestrator-side); planned_delivery or delivery_metrics with governance_context = execution or lifecycle check (committed, service-side). Proposal acceptance supplies the immutable proposal separately so governance can inspect its typed commercial terms while payload remains the exact downstream arguments. MediaBuy controls use buyer-proposed and seller-computed positive-delta ceilings. The first check is addressed by plan_id. Subsequent service-side checks use the opaque governance_context as the authoritative plan binding.'

Universal governance check for campaign actions. The governance agent infers the check type from the fields present: tool+payload = intent check (proposed, orchestrator-side); planned_delivery or delivery_metrics with governance_context = execution or lifecycle check (committed, service-side). Proposal acceptance supplies the immutable proposal separately so governance can inspect its typed commercial terms while payload remains the exact downstream arguments. MediaBuy controls use buyer-proposed and seller-computed positive-delta ceilings. The first check is addressed by plan_id. Subsequent service-side checks use the opaque governance_context as the authoritative plan binding.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config

Inherited members

class CheckGovernanceRequest1 (**data: Any)
Expand source code
class CheckGovernanceRequest1(AdCPBaseModel):
    pass

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var model_config

Inherited members

class CheckGovernanceRequest2 (**data: Any)
Expand source code
class CheckGovernanceRequest2(AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    plan_id: Annotated[
        str | None,
        Field(
            description="Campaign governance plan identifier. Required on the initial intent or availability check, before a governance_context exists. Optional on subsequent checks: the governance agent derives the plan from its own signed governance_context. If both are present, the governance agent MUST reject the request when plan_id does not match the token's plan binding. Services MUST treat governance_context as authoritative and MUST NOT require a buyer to disclose plan_id. A plan is owned by the authenticated buyer principal that synchronized it; plan_id is an identifier, not an account credential."
        ),
    ] = None
    caller: Annotated[
        AnyUrl,
        Field(
            description='Claimed URL of the agent making the request. The transport credential MUST resolve to an agent URL; the governance agent requires an exact match and uses only that resolved URL for authorization, audit, and signed context issuance. On intent checks the authenticated buyer must be the plan owner or hold an active delegation, while approved_sellers is evaluated against the target service that becomes the token audience. On execution checks the authenticated caller MUST equal that preserved audience. An unresolved body assertion never grants plan access or authorization.'
        ),
    ]
    purchase_type: Annotated[
        purchase_type_1.PurchaseType | None,
        Field(
            description="The type of financial commitment being checked. Determines which budget allocation (if any) to validate against. Defaults to 'media_buy' when omitted."
        ),
    ] = purchase_type_1.PurchaseType.media_buy
    target_agent: Annotated[
        AnyUrl | None,
        Field(
            description='Exact agent URL of the downstream service that will receive the governed task. Required on intent checks and copied byte-for-byte into the signed governance_context aud claim. This routing and authorization field is not part of payload: payload remains exactly the downstream task arguments. A consultation re-check MUST use the same target_agent.'
        ),
    ] = None
    proposed_commitment: Annotated[
        ProposedCommitment | None,
        Field(
            description='Task-neutral monetary amount the intent would authorize. For update_media_buy and control_media_buy this is the buyer-computed positive incremental commitment, not the post-update total. For accept_proposal it is derived from the supplied proposal commercial_terms; for buy_products it is derived from the purchase payload. Amount 0 explicitly represents a verified no-cost action. The governance agent persists this value as authoritative check state.'
        ),
    ] = None
    execution_commitment: Annotated[
        ExecutionCommitment | None,
        Field(
            description='Seller-computed positive incremental commitment for a MediaBuy execution check. The seller MUST derive this atomically from its authoritative proposal or current revision and the requested operation, and the governance agent MUST reject it when it exceeds the prior intent ceiling or uses another currency.'
        ),
    ] = None
    tool: Annotated[
        str | None,
        Field(
            description="The AdCP tool being checked (e.g., 'create_media_buy', 'acquire_rights', 'activate_signal'). Present on intent checks (orchestrator). The governance agent uses the presence of tool+payload to identify an intent check."
        ),
    ] = None
    payload: Annotated[
        dict[str, Any] | None,
        Field(
            description='The full downstream tool arguments exactly as they will be sent to target_agent. Present on intent checks. Governance routing metadata is carried by target_agent, never injected into this object. The governance agent can inspect any field to validate against the plan.'
        ),
    ] = None
    proposal: Annotated[
        canonical_proposal.CanonicalProposal | None,
        Field(
            description='Exact committed proposal being authorized for accept_proposal. The governance agent verifies proposal.terms_digest against commercial_terms and binds that digest into its decision state; the downstream payload carries the same digest without repeating the terms.'
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Opaque authorization context from a prior approved check_governance response. Services pass it verbatim on execution and lifecycle checks; the issuing governance agent derives the plan and prior decision from the token. Intermediaries MUST NOT parse it for business logic. Governance agents MUST emit a compact JWS per the AdCP JWS profile.',
            max_length=4096,
            min_length=1,
            pattern='^[\\x20-\\x7E]+$',
        ),
    ] = None
    consultation_context: Annotated[
        str | None,
        Field(
            description='Opaque, non-authorizing handle returned with an intent conditions verdict. Pass it only when re-checking the adjusted intent so the governance agent can correlate negotiation attempts. The governance agent MUST resolve it under the authenticated principal and reject the re-check unless principal, caller, plan_id, tool, purchase_type, and target audience match the original conditions check. Services MUST NOT receive or accept this value as authorization.',
            max_length=255,
            min_length=1,
            pattern='^[A-Za-z0-9_.:-]+$',
        ),
    ] = None
    phase: Annotated[
        governance_phase.GovernancePhase | None,
        Field(
            description="The phase of an execution-shaped governed action. Ignored for intent-shaped tool+payload requests. 'purchase': initial commitment; 'modification': update to an existing commitment; 'delivery': periodic delivery reporting. Defaults to purchase if omitted. planned_delivery_1.media_buy_id is optional for purchase and required for modification/delivery."
        ),
    ] = governance_phase.GovernancePhase.purchase
    planned_delivery: Annotated[
        planned_delivery_1.PlannedDelivery | None,
        Field(description='What the seller will actually deliver. Present on execution checks.'),
    ] = None
    delivery_metrics: Annotated[
        DeliveryMetrics | None,
        Field(
            description="Seller-attributed canonical delivery statement. MUST be present for 'delivery' phase. The authenticated seller binds one immutable statement_id and digest to a monotonically increasing sequence; the buyer can later submit the copy it received or an independent observation through report_plan_outcome."
        ),
    ] = None
    modification_summary: Annotated[
        str | None,
        Field(
            description="Human-readable summary of what changed. SHOULD be present for 'modification' phase.",
            max_length=1000,
        ),
    ] = None
    runtime_attestations: Annotated[
        list[RuntimeAttestation] | None,
        Field(
            description='Optional independently issued runtime evidence for an activate_signal intent check whose payload action is activate (or omitted, which defaults to activate). It MUST NOT be supplied for deactivate. Each item is the shared portable AttestationReference from the core #4529 contract; it carries no authoritative buyer-supplied decision or confidence. The governance agent MUST evaluate every item under adcp.attestations plus governance.runtime_attestations capability policy, preserve input order in response runtime_attestation_evaluations[], and reject off-policy issuers, resolvers, credential origins, and verifier nominations without network access. This field is per-check evidence outside the synced plan and therefore outside the plan_hash preimage. Other tools and purchase types cannot carry this field.',
            max_length=10,
            min_length=1,
        ),
    ] = None
    invoice_recipient: Annotated[
        business_entity.BusinessEntity | None,
        Field(
            description='Invoice recipient from the purchase request. MUST be present when the tool payload includes invoice_recipient, so the governance agent can validate billing changes.'
        ),
    ] = None
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var caller : pydantic.networks.AnyUrl
var consultation_context : str | None
var context : ContextObject | None
var delivery_metrics : DeliveryMetrics | None
var execution_commitment : ExecutionCommitment | None
var ext : ExtensionObject | None
var governance_context : str | None
var invoice_recipient : BusinessEntity | None
var model_config
var modification_summary : str | None
var payload : dict[str, typing.Any] | None
var phase : GovernancePhase | None
var plan_id : str | None
var planned_delivery : PlannedDelivery | None
var proposal : CanonicalProposal | None
var proposed_commitment : ProposedCommitment | None
var purchase_type : PurchaseType | None
var runtime_attestations : list[RuntimeAttestation] | None
var target_agent : pydantic.networks.AnyUrl | None
var tool : str | None

Inherited members

class CheckGovernanceRequest3 (**data: Any)
Expand source code
class CheckGovernanceRequest3(CheckGovernanceRequest1, CheckGovernanceRequest2):
    model_config = ConfigDict(
        extra='allow',
    )
    plan_id: Annotated[
        str | None,
        Field(
            description="Campaign governance plan identifier. Required on the initial intent or availability check, before a governance_context exists. Optional on subsequent checks: the governance agent derives the plan from its own signed governance_context. If both are present, the governance agent MUST reject the request when plan_id does not match the token's plan binding. Services MUST treat governance_context as authoritative and MUST NOT require a buyer to disclose plan_id. A plan is owned by the authenticated buyer principal that synchronized it; plan_id is an identifier, not an account credential."
        ),
    ] = None
    caller: Annotated[
        AnyUrl,
        Field(
            description='Claimed URL of the agent making the request. The transport credential MUST resolve to an agent URL; the governance agent requires an exact match and uses only that resolved URL for authorization, audit, and signed context issuance. On intent checks the authenticated buyer must be the plan owner or hold an active delegation, while approved_sellers is evaluated against the target service that becomes the token audience. On execution checks the authenticated caller MUST equal that preserved audience. An unresolved body assertion never grants plan access or authorization.'
        ),
    ]
    purchase_type: Annotated[
        purchase_type_1.PurchaseType | None,
        Field(
            description="The type of financial commitment being checked. Determines which budget allocation (if any) to validate against. Defaults to 'media_buy' when omitted."
        ),
    ] = purchase_type_1.PurchaseType.media_buy
    target_agent: Annotated[
        AnyUrl | None,
        Field(
            description='Exact agent URL of the downstream service that will receive the governed task. Required on intent checks and copied byte-for-byte into the signed governance_context aud claim. This routing and authorization field is not part of payload: payload remains exactly the downstream task arguments. A consultation re-check MUST use the same target_agent.'
        ),
    ] = None
    proposed_commitment: Annotated[
        ProposedCommitment | None,
        Field(
            description='Task-neutral monetary amount the intent would authorize. For update_media_buy and control_media_buy this is the buyer-computed positive incremental commitment, not the post-update total. For accept_proposal it is derived from the supplied proposal commercial_terms; for buy_products it is derived from the purchase payload. Amount 0 explicitly represents a verified no-cost action. The governance agent persists this value as authoritative check state.'
        ),
    ] = None
    execution_commitment: Annotated[
        ExecutionCommitment | None,
        Field(
            description='Seller-computed positive incremental commitment for a MediaBuy execution check. The seller MUST derive this atomically from its authoritative proposal or current revision and the requested operation, and the governance agent MUST reject it when it exceeds the prior intent ceiling or uses another currency.'
        ),
    ] = None
    tool: Annotated[
        str | None,
        Field(
            description="The AdCP tool being checked (e.g., 'create_media_buy', 'acquire_rights', 'activate_signal'). Present on intent checks (orchestrator). The governance agent uses the presence of tool+payload to identify an intent check."
        ),
    ] = None
    payload: Annotated[
        dict[str, Any] | None,
        Field(
            description='The full downstream tool arguments exactly as they will be sent to target_agent. Present on intent checks. Governance routing metadata is carried by target_agent, never injected into this object. The governance agent can inspect any field to validate against the plan.'
        ),
    ] = None
    proposal: Annotated[
        canonical_proposal.CanonicalProposal | None,
        Field(
            description='Exact committed proposal being authorized for accept_proposal. The governance agent verifies proposal.terms_digest against commercial_terms and binds that digest into its decision state; the downstream payload carries the same digest without repeating the terms.'
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Opaque authorization context from a prior approved check_governance response. Services pass it verbatim on execution and lifecycle checks; the issuing governance agent derives the plan and prior decision from the token. Intermediaries MUST NOT parse it for business logic. Governance agents MUST emit a compact JWS per the AdCP JWS profile.',
            max_length=4096,
            min_length=1,
            pattern='^[\\x20-\\x7E]+$',
        ),
    ] = None
    consultation_context: Annotated[
        str | None,
        Field(
            description='Opaque, non-authorizing handle returned with an intent conditions verdict. Pass it only when re-checking the adjusted intent so the governance agent can correlate negotiation attempts. The governance agent MUST resolve it under the authenticated principal and reject the re-check unless principal, caller, plan_id, tool, purchase_type, and target audience match the original conditions check. Services MUST NOT receive or accept this value as authorization.',
            max_length=255,
            min_length=1,
            pattern='^[A-Za-z0-9_.:-]+$',
        ),
    ] = None
    phase: Annotated[
        governance_phase.GovernancePhase | None,
        Field(
            description="The phase of an execution-shaped governed action. Ignored for intent-shaped tool+payload requests. 'purchase': initial commitment; 'modification': update to an existing commitment; 'delivery': periodic delivery reporting. Defaults to purchase if omitted. planned_delivery_1.media_buy_id is optional for purchase and required for modification/delivery."
        ),
    ] = governance_phase.GovernancePhase.purchase
    planned_delivery: Annotated[
        planned_delivery_1.PlannedDelivery | None,
        Field(description='What the seller will actually deliver. Present on execution checks.'),
    ] = None
    delivery_metrics: Annotated[
        DeliveryMetrics2 | None,
        Field(
            description="Seller-attributed canonical delivery statement. MUST be present for 'delivery' phase. The authenticated seller binds one immutable statement_id and digest to a monotonically increasing sequence; the buyer can later submit the copy it received or an independent observation through report_plan_outcome."
        ),
    ] = None
    modification_summary: Annotated[
        str | None,
        Field(
            description="Human-readable summary of what changed. SHOULD be present for 'modification' phase.",
            max_length=1000,
        ),
    ] = None
    runtime_attestations: Annotated[
        list[RuntimeAttestation1] | None,
        Field(
            description='Optional independently issued runtime evidence for an activate_signal intent check whose payload action is activate (or omitted, which defaults to activate). It MUST NOT be supplied for deactivate. Each item is the shared portable AttestationReference from the core #4529 contract; it carries no authoritative buyer-supplied decision or confidence. The governance agent MUST evaluate every item under adcp.attestations plus governance.runtime_attestations capability policy, preserve input order in response runtime_attestation_evaluations[], and reject off-policy issuers, resolvers, credential origins, and verifier nominations without network access. This field is per-check evidence outside the synced plan and therefore outside the plan_hash preimage. Other tools and purchase types cannot carry this field.',
            max_length=10,
            min_length=1,
        ),
    ] = None
    invoice_recipient: Annotated[
        business_entity.BusinessEntity | None,
        Field(
            description='Invoice recipient from the purchase request. MUST be present when the tool payload includes invoice_recipient, so the governance agent can validate billing changes.'
        ),
    ] = None
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var caller : pydantic.networks.AnyUrl
var consultation_context : str | None
var context : ContextObject | None
var delivery_metrics : DeliveryMetrics2 | None
var execution_commitment : ExecutionCommitment | None
var ext : ExtensionObject | None
var governance_context : str | None
var invoice_recipient : BusinessEntity | None
var model_config
var modification_summary : str | None
var payload : dict[str, typing.Any] | None
var phase : GovernancePhase | None
var plan_id : str | None
var planned_delivery : PlannedDelivery | None
var proposal : CanonicalProposal | None
var proposed_commitment : ProposedCommitment | None
var purchase_type : PurchaseType | None
var runtime_attestations : list[RuntimeAttestation1] | None
var target_agent : pydantic.networks.AnyUrl | None
var tool : str | None

Inherited members

class CheckGovernanceResponse (**data: Any)
Expand source code
class CheckGovernanceResponse(AdcpResponse, AdcpVersionEnvelope):
    @model_validator(mode='before')
    @classmethod
    def _status_to_verdict(cls, data: Any) -> Any:
        if isinstance(data, dict) and 'verdict' not in data and 'status' in data:
            data = dict(data)
            data['verdict'] = data['status']
        return data

    model_config = ConfigDict(
        extra='allow',
    )
    check_id: Annotated[
        str,
        Field(
            description='Unique identifier for this governance check record. Use in report_plan_outcome to link outcomes to the check that authorized them.'
        ),
    ]
    verdict: Annotated[
        governance_decision.GovernanceDecision,
        Field(
            description='Governance verdict: approved | denied | conditions. Renamed from `status` in 3.1 to free the top-level `status` key for the envelope task-status (TaskStatus) under MCP flat-on-the-wire serialization. The enum values are unchanged; only the property name moved.'
        ),
    ]
    check_type: Annotated[
        CheckType | None,
        Field(
            description='Check shape that produced the verdict. Required for the cross-role governance_enforcement contract. Its presence selects the modern verdict-specific response rules; its absence selects the deprecated legacy 3.x compatibility shape. Intent checks may return conditions; execution checks are binary approved or denied.'
        ),
    ] = None
    plan_id: Annotated[
        str | None,
        Field(
            description='Plan identifier echoed on an initial plan-addressed check. Optional on continuation checks addressed by governance_context; services do not need this value and MUST treat the token binding as authoritative.'
        ),
    ] = None
    explanation: Annotated[
        str, Field(description='Human-readable explanation of the governance decision.')
    ]
    findings: Annotated[
        list[Finding] | None,
        Field(
            description="Specific issues found during the governance check. Present when verdict is 'denied' or 'conditions'. MAY also be present on 'approved' for informational findings (e.g., budget approaching limit)."
        ),
    ] = None
    conditions: Annotated[
        list[Condition] | None,
        Field(
            description="Intent-phase counterproposal. Present only when verdict is 'conditions'. It does not authorize execution and MUST NOT be returned for execution or lifecycle checks. Each field path is rooted at the complete check_governance request arguments, so both payload.* and proposed_commitment.* can be addressed. After applying conditions, the caller MUST re-call check_governance with the adjusted parameters and receive approved before proceeding."
        ),
    ] = None
    consultation_context: Annotated[
        str | None,
        Field(
            description='Opaque negotiation handle present only with modern conditions responses. It carries no authorization and MUST NOT be sent to a downstream service. The governance agent MUST bind it server-side to the authenticated principal, caller, plan, tool, purchase type, and target audience, and reject a re-check if any binding changes. The buyer returns it only on the adjusted intent re-check.',
            max_length=255,
            min_length=1,
            pattern='^[A-Za-z0-9_.:-]+$',
        ),
    ] = None
    expires_at: Annotated[
        AwareDatetime | None,
        Field(
            description="When this approval expires. In the cross-role shape, present only when verdict is 'approved'. Deprecated legacy conditions responses may also carry it for 3.x compatibility. The caller must act before this time or re-call check_governance. A lapsed approval is no approval."
        ),
    ] = None
    next_check: Annotated[
        AwareDatetime | None,
        Field(
            description='When the seller should next call check_governance with delivery metrics. Present when the governance agent expects ongoing delivery reporting.'
        ),
    ] = None
    delivery_statement: Annotated[
        DeliveryStatement | None,
        Field(
            description='Canonical seller-attributed delivery statement retained by governance. Present on delivery execution checks. The buyer binds any later observation to this exact statement through report_plan_outcome.'
        ),
    ] = None
    categories_evaluated: Annotated[
        list[str] | None,
        Field(
            description="Governance categories evaluated during this check. Each value is an **agent-internal** label (e.g., `budget_authority`, `regulatory_compliance`, or any internal-reviewer key the agent's policy model defines) — not a protocol-level enum. Since one governance agent per account composes all specialist review behind its single endpoint, `categories_evaluated` is how that internal decomposition surfaces to auditors. Consumers MUST treat values as opaque labels for display and audit, not as a machine-level contract."
        ),
    ] = None
    policies_evaluated: Annotated[
        list[str] | None,
        Field(
            description="Policy IDs evaluated during this check. Includes registry policy IDs (resolved via the policy registry) and any inline `policy_id`s declared in the plan's `custom_policies`."
        ),
    ] = None
    mode: Annotated[
        governance_mode.GovernanceMode | None,
        Field(
            description='Governance enforcement mode active when this check was evaluated. Allows counterparties, regulators, and auditors to distinguish whether a finding blocked execution (enforce) or was logged silently (audit).'
        ),
    ] = None
    runtime_attestation_evaluations: Annotated[
        list[RuntimeAttestationEvaluation] | None,
        Field(
            description="Evaluator-of-record results for request runtime_attestations[], in the same order and with exactly one result per presentation. Each result is the shared AttestationEvaluation and MUST bind to this response's check_id through action_binding.action_type = https://adcontextprotocol.org/actions/governance-check and action_binding.action_id = check_id. The signed governance_context MUST bind the same reference_digest/outcome pairs; large evidence stays in the audit log rather than the token.",
            max_length=10,
            min_length=1,
        ),
    ] = None
    runtime_attestation_binding_digest: Annotated[
        str | None,
        Field(
            description='SHA-256 of RFC 8785 JCS({ evaluations: runtime_attestation_evaluations, findings: attestation_bound_findings }), where attestation_bound_findings is the response findings[] subset carrying attestation_reference_digest, preserved in response order. Required whenever runtime_attestation_evaluations is present. The governance_context JWS carries this exact value as runtime_attestation_binding_digest; get_plan_audit_logs retains ordered {reference, evaluation} pairs so auditors can first recompute every reference_digest and then prove which evaluations and findings the signed decision relied on.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Opaque authorization context for this governed action. Present only when verdict is approved; denied and conditions responses MUST NOT carry it. The buyer attaches it to the protocol envelope when sending the governed request. The service persists and forwards it on subsequent execution and lifecycle checks without requiring plan_id.\n\nGovernance agents MUST emit a compact JWS per the AdCP JWS profile. Verifiers validate the standard authorization claims but MUST NOT interpret embedded governance state for business logic. The issuing governance agent uses the token to recover its internal plan and decision state.',
            max_length=4096,
            min_length=1,
            pattern='^[\\x20-\\x7E]+$',
        ),
    ] = None
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The response message of a task in the pinned bundle's task registry.

A consumer holding one can route on task state, pick up an async task_id, split envelope from payload and log uniformly, before knowing which tool answered. Which makes one generic poll-to-terminal loop possible for all 77 tasks, where today each arm has no common type at all.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var categories_evaluated : list[str] | None
var check_id : str
var check_type : CheckType | None
var conditions : list[Condition] | None
var consultation_context : str | None
var context : ContextObject | None
var delivery_statement : DeliveryStatement | None
var expires_at : pydantic.types.AwareDatetime | None
var explanation : str
var ext : ExtensionObject | None
var findings : list[Finding] | None
var governance_context : str | None
var mode : GovernanceMode | None
var model_config
var next_check : pydantic.types.AwareDatetime | None
var plan_id : str | None
var policies_evaluated : list[str] | None
var runtime_attestation_binding_digest : str | None
var runtime_attestation_evaluations : list[RuntimeAttestationEvaluation] | None
var verdict : GovernanceDecision

Inherited members

class ClassificationSource (*args, **kwds)
Expand source code
class ClassificationSource(StrEnum):
    seller_response_copy = 'seller_response_copy'
    buyer_classification = 'buyer_classification'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var buyer_classification
var seller_response_copy
class Condition (**data: Any)
Expand source code
class Condition(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    field: Annotated[
        str,
        Field(
            description='Dot-path rooted at the complete check_governance request arguments (for example payload.total_budget.amount or proposed_commitment.amount). Conditions are not valid for committed execution checks.'
        ),
    ]
    required_value: Annotated[
        Any | None,
        Field(
            description='The value the field must have for approval. When present, the condition is machine-actionable. When absent, the condition is advisory.'
        ),
    ] = None
    reason: Annotated[str, Field(description='Why this condition is required.')]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var field : str
var model_config
var reason : str
var required_value : typing.Any | None

Inherited members

class Decision (*args, **kwds)
Expand source code
class Decision(StrEnum):
    accept = 'accept'
    dispute = 'dispute'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var accept
var dispute
class Delegation (**data: Any)
Expand source code
class Delegation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    agent_url: Annotated[AnyUrl, Field(description='URL of the delegated agent.')]
    authority: Annotated[
        delegation_authority.DelegationAuthority,
        Field(description='Authority level granted to this agent.'),
    ]
    budget_limit: Annotated[
        BudgetLimit | None,
        Field(
            description="Maximum budget this agent can commit. When omitted, the agent can commit up to the plan's total budget."
        ),
    ] = None
    markets: Annotated[
        list[str] | None,
        Field(
            description='ISO 3166-1/3166-2 codes this agent is authorized for. When omitted, the agent can operate in all plan markets.'
        ),
    ] = None
    expires_at: Annotated[
        AwareDatetime | None,
        Field(
            description='When this delegation expires. After expiration, the governance agent denies actions from this agent.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var agent_url : pydantic.networks.AnyUrl
var authority : DelegationAuthority
var budget_limit : BudgetLimit | None
var expires_at : pydantic.types.AwareDatetime | None
var markets : list[str] | None
var model_config

Inherited members

class DeliveryMetrics (**data: Any)
Expand source code
class DeliveryMetrics(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    statement_id: Annotated[
        str | None,
        Field(
            description='Stable seller-issued identifier for this immutable delivery statement.',
            max_length=255,
            min_length=1,
        ),
    ] = None
    statement_digest: Annotated[
        str | None,
        Field(
            description='SHA-256 digest of RFC 8785 JCS over {seller_reference, delivery_metrics}, excluding statement_digest itself. The authenticated submission binds the seller to this digest.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None
    sequence: Annotated[
        SchemaInt | None,
        Field(
            description='Monotonically increasing sequence for this governed action. A statement ID or sequence cannot be reused with different content.',
            ge=1,
        ),
    ] = None
    issued_at: Annotated[
        AwareDatetime | None, Field(description='When the seller issued the canonical statement.')
    ] = None
    reporting_period: Annotated[
        ReportingPeriod, Field(description='Start and end timestamps for the reporting window.')
    ]
    spend: Annotated[
        StrictFloat | None, Field(description='Total spend during the reporting period.', ge=0.0)
    ] = None
    cumulative_spend: Annotated[
        StrictFloat | None,
        Field(description='Total spend since the governed action started.', ge=0.0),
    ] = None
    currency: Annotated[
        str | None,
        Field(
            description='Currency of spend fields; must match the plan and planned delivery.',
            pattern='^[A-Z]{3}$',
        ),
    ] = None
    impressions: Annotated[
        SchemaInt | None,
        Field(description='Impressions delivered during the reporting period.', ge=0),
    ] = None
    cumulative_impressions: Annotated[
        SchemaInt | None,
        Field(description='Total impressions since the governed action started.', ge=0),
    ] = None
    geo_distribution: Annotated[
        dict[str, StrictFloat] | None,
        Field(
            description='Actual geographic distribution. Keys are ISO 3166-1 alpha-2 codes, values are percentages.'
        ),
    ] = None
    channel_distribution: Annotated[
        dict[str, StrictFloat] | None,
        Field(
            description='Actual channel distribution. Keys are channel enum values, values are percentages.'
        ),
    ] = None
    pacing: Annotated[
        Pacing | None,
        Field(
            description='Whether delivery is ahead of, on track with, or behind the planned pace.'
        ),
    ] = None
    audience_distribution: Annotated[
        AudienceDistribution | None,
        Field(
            description='Actual audience composition during the reporting period. Enables mid-flight drift detection when actual delivery skews from planned audience targeting.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var audience_distribution : AudienceDistribution | None
var channel_distribution : dict[str, float] | None
var cumulative_impressions : int | None
var cumulative_spend : float | None
var currency : str | None
var geo_distribution : dict[str, float] | None
var impressions : int | None
var issued_at : pydantic.types.AwareDatetime | None
var model_config
var pacing : Pacing | None
var reporting_period : ReportingPeriod
var sequence : int | None
var spend : float | None
var statement_digest : str | None
var statement_id : str | None

Inherited members

class DeliveryMetrics2 (**data: Any)
Expand source code
class DeliveryMetrics2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    statement_id: Annotated[
        str | None,
        Field(
            description='Stable seller-issued identifier for this immutable delivery statement.',
            max_length=255,
            min_length=1,
        ),
    ] = None
    statement_digest: Annotated[
        str | None,
        Field(
            description='SHA-256 digest of RFC 8785 JCS over {seller_reference, delivery_metrics}, excluding statement_digest itself. The authenticated submission binds the seller to this digest.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None
    sequence: Annotated[
        SchemaInt | None,
        Field(
            description='Monotonically increasing sequence for this governed action. A statement ID or sequence cannot be reused with different content.',
            ge=1,
        ),
    ] = None
    issued_at: Annotated[
        AwareDatetime | None, Field(description='When the seller issued the canonical statement.')
    ] = None
    reporting_period: Annotated[
        ReportingPeriod, Field(description='Start and end timestamps for the reporting window.')
    ]
    spend: Annotated[
        StrictFloat | None, Field(description='Total spend during the reporting period.', ge=0.0)
    ] = None
    cumulative_spend: Annotated[
        StrictFloat | None,
        Field(description='Total spend since the governed action started.', ge=0.0),
    ] = None
    currency: Annotated[
        str | None,
        Field(
            description='Currency of spend fields; must match the plan and planned delivery.',
            pattern='^[A-Z]{3}$',
        ),
    ] = None
    impressions: Annotated[
        SchemaInt | None,
        Field(description='Impressions delivered during the reporting period.', ge=0),
    ] = None
    cumulative_impressions: Annotated[
        SchemaInt | None,
        Field(description='Total impressions since the governed action started.', ge=0),
    ] = None
    geo_distribution: Annotated[
        dict[str, StrictFloat] | None,
        Field(
            description='Actual geographic distribution. Keys are ISO 3166-1 alpha-2 codes, values are percentages.'
        ),
    ] = None
    channel_distribution: Annotated[
        dict[str, StrictFloat] | None,
        Field(
            description='Actual channel distribution. Keys are channel enum values, values are percentages.'
        ),
    ] = None
    pacing: Annotated[
        Pacing | None,
        Field(
            description='Whether delivery is ahead of, on track with, or behind the planned pace.'
        ),
    ] = None
    audience_distribution: Annotated[
        AudienceDistribution1 | None,
        Field(
            description='Actual audience composition during the reporting period. Enables mid-flight drift detection when actual delivery skews from planned audience targeting.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var audience_distribution : AudienceDistribution1 | None
var channel_distribution : dict[str, float] | None
var cumulative_impressions : int | None
var cumulative_spend : float | None
var currency : str | None
var geo_distribution : dict[str, float] | None
var impressions : int | None
var issued_at : pydantic.types.AwareDatetime | None
var model_config
var pacing : Pacing | None
var reporting_period : ReportingPeriod
var sequence : int | None
var spend : float | None
var statement_digest : str | None
var statement_id : str | None

Inherited members

class DeliveryReportingPeriod (**data: Any)
Expand source code
class DeliveryReportingPeriod(ReportingPeriod):
    pass

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config

Inherited members

class DriftMetrics (**data: Any)
Expand source code
class DriftMetrics(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    escalation_rate: Annotated[
        StrictFloat | None,
        Field(description='Fraction of checks that resulted in escalation.', ge=0.0, le=1.0),
    ] = None
    escalation_rate_trend: Annotated[
        EscalationRateTrend | None,
        Field(description="Direction of escalation rate over the plan's lifetime."),
    ] = None
    auto_approval_rate: Annotated[
        StrictFloat | None,
        Field(
            description='Fraction of checks approved without human intervention.', ge=0.0, le=1.0
        ),
    ] = None
    human_override_rate: Annotated[
        StrictFloat | None,
        Field(
            description="Fraction of escalations where the human overrode the governance agent's recommendation.",
            ge=0.0,
            le=1.0,
        ),
    ] = None
    mean_confidence: Annotated[
        StrictFloat | None,
        Field(
            description='Average confidence score across all findings. Present when findings include confidence scores.',
            ge=0.0,
            le=1.0,
        ),
    ] = None
    thresholds: Annotated[
        Thresholds | None,
        Field(
            description='Organization-defined thresholds for drift metrics. When a metric crosses its threshold, the governance agent SHOULD include a finding on the next check. Set by the organization in governance agent configuration, echoed here for visibility.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var auto_approval_rate : float | None
var escalation_rate : float | None
var escalation_rate_trend : EscalationRateTrend | None
var human_override_rate : float | None
var mean_confidence : float | None
var model_config
var thresholds : Thresholds | None

Inherited members

class Entry (**data: Any)
Expand source code
class Entry(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    id: Annotated[str, Field(description='Entry identifier.')]
    type: Annotated[Type, Field(description='Entry type.')]
    timestamp: Annotated[AwareDatetime, Field(description='ISO 8601 timestamp.')]
    plan_id: Annotated[
        str | None,
        Field(
            description='Plan this entry belongs to. Present when querying multiple plans or a portfolio.'
        ),
    ] = None
    caller: Annotated[
        AnyUrl | None,
        Field(
            description='URL of the agent that made the request. Resolved from the credentials used on the governance callback.'
        ),
    ] = None
    tool: Annotated[str | None, Field(description='The AdCP tool (present for check entries).')] = (
        None
    )
    verdict: Annotated[
        governance_decision.GovernanceDecision | None,
        Field(
            description='Governance verdict (present for check entries). Renamed from `status` in 3.1 alongside check-governance-response for vocabulary consistency.'
        ),
    ] = None
    check_type: Annotated[
        CheckType | None,
        Field(
            description='Whether the check was an intent check (orchestrator) or execution check (seller). Inferred from the fields present on the original check request. Present for check entries.'
        ),
    ] = None
    mode: Annotated[
        governance_mode.GovernanceMode | None,
        Field(
            description="Governance mode active at the moment this specific check was evaluated. Governance agents SHOULD populate this field on check entries, recording the mode from their runtime configuration at the moment check_governance was processed — not derived from a plan field. This is a per-check value: if the operator changes mode between checks for the same governed action, each entry records the mode active for that entry. A future `governed_actions[].mode` field would describe the action's current mode, which may differ from the most recent entry's `mode` if the plan has since been re-synced. Absent for outcome entries and for pre-3.1 governance agents that do not surface mode on audit responses."
        ),
    ] = None
    explanation: Annotated[
        str | None,
        Field(
            description='Human-readable explanation of the governance decision (present for check entries).'
        ),
    ] = None
    policies_evaluated: Annotated[
        list[str] | None,
        Field(
            description="Policy IDs evaluated during this check. Includes registry policy IDs (resolved via the policy registry) and any inline `policy_id`s declared in the plan's `custom_policies`. Present for check entries."
        ),
    ] = None
    categories_evaluated: Annotated[
        list[str] | None,
        Field(
            description="Governance categories evaluated (e.g., 'budget_authority', 'regulatory_compliance'). Present for check entries."
        ),
    ] = None
    findings: Annotated[
        list[Finding] | None,
        Field(
            description='Findings from this check or outcome. Same structure as check_governance response findings.'
        ),
    ] = None
    delivery_statement: Annotated[
        DeliveryStatement | None,
        Field(description='Canonical seller statement retained on a delivery check entry.'),
    ] = None
    outcome: Annotated[
        outcome_type.OutcomeType | None,
        Field(description='Outcome type (present for outcome entries).'),
    ] = None
    error: Annotated[
        reported_outcome_error.ReportedOutcomeError | None,
        Field(
            description='Buyer-attributed error retained from a failed report_plan_outcome call. This is a copy or classification supplied by the reporter, not authenticated seller evidence.'
        ),
    ] = None
    outcome_id: Annotated[
        str | None, Field(description='Source completed outcome (present for adjustment entries).')
    ] = None
    seller_adjustment_id: Annotated[
        str | None,
        Field(
            description='Seller-issued source adjustment identifier (present for adjustment entries).'
        ),
    ] = None
    adjustment_type: Annotated[
        AdjustmentType | None,
        Field(description='Commercial adjustment type (present for adjustment entries).'),
    ] = None
    amount: Annotated[
        Amount | None,
        Field(description='Adjustment amount and currency (present for adjustment entries).'),
    ] = None
    headroom_restored: Annotated[
        StrictFloat | None,
        Field(
            description='Current-obligation headroom restored by this adjustment. Zero for audit-only types.',
            ge=0.0,
        ),
    ] = None
    reason: Annotated[str | None, Field(description='Seller-supplied adjustment reason.')] = None
    effective_at: Annotated[
        AwareDatetime | None, Field(description="When the seller's adjustment became effective.")
    ] = None
    committed_budget: Annotated[
        StrictFloat | None,
        Field(
            description='Governance-authorized budget reserved (present for completed outcome entries).'
        ),
    ] = None
    reported_committed_budget: Annotated[
        StrictFloat | None,
        Field(
            description='Caller-reported seller amount retained for reconciliation. Never ledger authority.',
            ge=0.0,
        ),
    ] = None
    seller_reference: Annotated[
        str | None, Field(description='Seller resource identifier retained on an outcome entry.')
    ] = None
    delivery: Annotated[
        Delivery | None,
        Field(
            description='Buyer-attributed observation retained as audit evidence on a delivery outcome. It never overwrites the seller statement.'
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Governance context for this entry (present for check and outcome entries).'
        ),
    ] = None
    plan_hash: Annotated[
        str | None,
        Field(
            description='Audit-layer binding to the plan revision this attestation was evaluated over — base64url_no_pad(SHA-256(JCS(plan_payload))) per Plan binding and audit in the campaign-governance specification. Present on check entries. Auditors and buyer-side compliance verify by recomputing over the retained plan revision and byte-comparing the decoded 32-byte digests.',
            pattern='^[A-Za-z0-9_-]{43}$',
        ),
    ] = None
    runtime_attestations: Annotated[
        list[RuntimeAttestation] | None,
        Field(
            description='Portable attestation presentations and their evaluator-of-record results retained as ordered pairs for this check entry. Auditors recompute each evaluation.reference_digest from JCS(reference), then recompute runtime_attestation_binding_digest from the ordered evaluations and attestation-bound findings.',
            max_length=10,
            min_length=1,
        ),
    ] = None
    runtime_attestation_binding_digest: Annotated[
        str | None,
        Field(
            description="Binding digest copied from the check response and signed governance_context. Auditors recompute it from this entry's ordered runtime_attestations[].evaluation values plus findings carrying attestation_reference_digest after verifying each paired reference digest.",
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None
    purchase_type: Annotated[
        purchase_type_1.PurchaseType | None, Field(description='Purchase type for this entry.')
    ] = None
    outcome_status: Annotated[
        str | None, Field(description='Outcome status (present for outcome entries).')
    ] = None
    delivery_reconciliation_status: DeliveryReconciliationStatus | None = None
    delivery_period_state: Annotated[
        DeliveryPeriodState | None,
        Field(description='Operational governance-window state for this delivery observation.'),
    ] = None
    adjustment_state: AdjustmentState | None = None
    verified_amount: Annotated[StrictFloat | None, Field(ge=0.0)] = None
    evidence: Evidence | None = None
    reviewed_by: AnyUrl | None = None
    reviewed_at: AwareDatetime | None = None
    review_reason: str | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var adjustment_state : AdjustmentState | None
var adjustment_type : AdjustmentType | None
var amount : Amount | None
var caller : pydantic.networks.AnyUrl | None
var categories_evaluated : list[str] | None
var check_type : CheckType | None
var committed_budget : float | None
var delivery : Delivery | None
var delivery_period_state : DeliveryPeriodState | None
var delivery_reconciliation_status : DeliveryReconciliationStatus | None
var delivery_statement : DeliveryStatement | None
var effective_at : pydantic.types.AwareDatetime | None
var error : ReportedOutcomeError | None
var evidence : Evidence | None
var explanation : str | None
var findings : list[Finding] | None
var governance_context : str | None
var headroom_restored : float | None
var id : str
var mode : GovernanceMode | None
var model_config
var outcome : OutcomeType | None
var outcome_id : str | None
var outcome_status : str | None
var plan_hash : str | None
var plan_id : str | None
var policies_evaluated : list[str] | None
var purchase_type : PurchaseType | None
var reason : str | None
var reported_committed_budget : float | None
var review_reason : str | None
var reviewed_at : pydantic.types.AwareDatetime | None
var reviewed_by : pydantic.networks.AnyUrl | None
var runtime_attestation_binding_digest : str | None
var runtime_attestations : list[RuntimeAttestation] | None
var seller_adjustment_id : str | None
var seller_reference : str | None
var timestamp : pydantic.types.AwareDatetime
var tool : str | None
var type : Type
var verdict : GovernanceDecision | None
var verified_amount : float | None

Inherited members

class Escalation (**data: Any)
Expand source code
class Escalation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    check_id: Annotated[str, Field(description='The escalated governance check.')]
    reason: Annotated[str, Field(description='Why it was escalated.')]
    resolution: Annotated[
        str | None,
        Field(description="How it was resolved (e.g., 'approved_by_human', 'rejected_by_human')."),
    ] = None
    resolved_at: Annotated[
        AwareDatetime | None, Field(description='ISO 8601 resolution timestamp.')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var check_id : str
var model_config
var reason : str
var resolution : str | None
var resolved_at : pydantic.types.AwareDatetime | None

Inherited members

class EscalationRateTrend (*args, **kwds)
Expand source code
class EscalationRateTrend(StrEnum):
    increasing = 'increasing'
    stable = 'stable'
    declining = 'declining'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var declining
var increasing
var stable
class ExecutionCommitment (**data: Any)
Expand source code
class ExecutionCommitment(ProposedCommitment):
    pass

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config

Inherited members

class Exemplar (**data: Any)
Expand source code
class Exemplar(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    scenario: Annotated[
        str,
        Field(description='A concrete scenario describing an advertising action or configuration.'),
    ]
    explanation: Annotated[str, Field(description='Why this scenario passes or fails the policy.')]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var explanation : str
var model_config
var scenario : str

Inherited members

class Exemplars (**data: Any)
Expand source code
class Exemplars(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    pass_: Annotated[
        list[Exemplar] | None,
        Field(alias='pass', description='Scenarios that comply with this policy.'),
    ] = None
    fail: Annotated[
        list[Exemplar] | None, Field(description='Scenarios that violate this policy.')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var fail : list[Exemplar] | None
var model_config
var pass_ : list[Exemplar] | None

Inherited members

class Facet (**data: Any)
Expand source code
class Facet(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    facet_id: Annotated[str, Field(pattern='^[a-z][a-z0-9_]*$')]
    name: Annotated[str, Field(min_length=1)]
    description: Annotated[str, Field(min_length=1)]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var description : str
var facet_id : str
var model_config
var name : str

Inherited members

class Flight (**data: Any)
Expand source code
class Flight(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    start: Annotated[AwareDatetime, Field(description='Flight start (ISO 8601).')]
    end: Annotated[AwareDatetime, Field(description='Flight end (ISO 8601).')]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var end : pydantic.types.AwareDatetime
var model_config
var start : pydantic.types.AwareDatetime

Inherited members

class GetPlanAuditLogsRequest (**data: Any)
Expand source code
class GetPlanAuditLogsRequest(AdcpRequest, AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    plan_ids: Annotated[
        list[str] | None,
        Field(
            description='Plan IDs to retrieve. For a single plan, pass a one-element array. Plans uniquely scope account and operator; do not include a separate `account` field — the governance agent resolves account from each plan. Including `account` is rejected by `additionalProperties: false`.',
            min_length=1,
        ),
    ] = None
    portfolio_plan_ids: Annotated[
        list[str] | None,
        Field(
            description='Portfolio plan IDs. The governance agent expands each to its member_plan_ids and returns combined audit data.',
            min_length=1,
        ),
    ] = None
    governance_contexts: Annotated[
        list[str] | None,
        Field(
            description='Filter audit entries by governance context. Returns only checks and outcomes that share these governance contexts, enabling lifecycle tracing across purchase types.',
            min_length=1,
        ),
    ] = None
    purchase_types: Annotated[
        list[purchase_type.PurchaseType] | None,
        Field(
            description="Filter audit entries by purchase type. Returns only checks and outcomes matching these purchase types (e.g., ['rights_license'] to see all rights activity).",
            min_length=1,
        ),
    ] = None
    include_entries: Annotated[
        StrictBool | None, Field(description='Include the full audit trail. Default: false.')
    ] = False
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

    @model_validator(mode='after')
    def _require_schema_required_group(self) -> GetPlanAuditLogsRequest:
        # ``required`` asks whether the caller supplied the field, which is what
        # model_fields_set answers. An explicit null is a supplied value — on a
        # mutation input it is the command to clear — and a default the caller
        # never sent is not.
        for group in (('plan_ids',), ('portfolio_plan_ids',), ('governance_contexts',),):
            if all(name in self.model_fields_set for name in group):
                return self
        raise ValueError(
            'GetPlanAuditLogsRequest requires at least one of these field groups: plan_ids | portfolio_plan_ids | governance_contexts'
        )

The request message of a task in the pinned bundle's task registry.

A consumer holding one can resolve its account, decide at-most-once, echo its context and negotiate version – the whole transport-boundary job – before knowing which tool it is. issubclass(model, AdcpRequest) is the registration-time proof that a model is spec-derived rather than a hand-written parallel: a field test passes for a forged model, descent does not.

Each accessor returns the field's value, or None when this tool's schema declares no such field. Only 49 of the 87 request schemas declare an account and only 43 an idempotency_key, so asking the request is what replaces getattr(req, "account", None) against Any at the boundary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var context : ContextObject | None
var ext : ExtensionObject | None
var governance_contexts : list[str] | None
var include_entries : bool | None
var model_config
var plan_ids : list[str] | None
var portfolio_plan_ids : list[str] | None
var purchase_types : list[PurchaseType] | None

Inherited members

class GetPlanAuditLogsResponse (**data: Any)
Expand source code
class GetPlanAuditLogsResponse(AdcpResponse, AdcpVersionEnvelope, ProtocolEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    plans: Annotated[list[Plan], Field(description='Audit data for each requested plan.')]
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The response message of a task in the pinned bundle's task registry.

A consumer holding one can route on task state, pick up an async task_id, split envelope from payload and log uniformly, before knowing which tool answered. Which makes one generic poll-to-terminal loop possible for all 77 tasks, where today each arm has no common type at all.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var context : ContextObject | None
var ext : ExtensionObject | None
var model_config
var plans : list[Plan]

Inherited members

class GovernedAction (**data: Any)
Expand source code
class GovernedAction(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    governance_context: Annotated[
        str, Field(description="Governance context correlating this action's lifecycle.")
    ]
    purchase_type: Annotated[
        purchase_type_1.PurchaseType, Field(description='Type of financial commitment.')
    ]
    status: Annotated[Status, Field(description='Action status.')]
    committed: Annotated[
        StrictFloat, Field(description='Gross authoritative commitment recorded for this action.')
    ]
    adjustments_reported: Annotated[
        StrictFloat | None,
        Field(description='Sum of all append-only adjustment amounts for this action.'),
    ] = None
    adjustments_verified: Annotated[
        StrictFloat | None, Field(description='Buyer-accepted economic reductions for this action.')
    ] = None
    net_cost: Annotated[
        StrictFloat | None,
        Field(description='Gross action commitment minus verified economic reductions.'),
    ] = None
    headroom_restored: Annotated[
        StrictFloat | None,
        Field(
            description='Verified adjustments eligible to restore headroom under the plan accounting mode.'
        ),
    ] = None
    net_committed: Annotated[
        StrictFloat | None,
        Field(description='Current ledger obligation for this action after restored headroom.'),
    ] = None
    seller_reported_spend: Annotated[StrictFloat | None, Field(ge=0.0)] = None
    buyer_observed_spend: Annotated[StrictFloat | None, Field(ge=0.0)] = None
    delivery_reporting_period: Annotated[
        DeliveryReportingPeriod | None,
        Field(description='Current seller statement period summarized for this governed action.'),
    ] = None
    conservative_exposure: Annotated[
        StrictFloat | None,
        Field(
            description='Greater of seller-reported and buyer-observed spend while evidence is unresolved.',
            ge=0.0,
        ),
    ] = None
    delivery_reconciliation_status: DeliveryReconciliationStatus | None = None
    delivery_period_state: Annotated[
        DeliveryPeriodState | None,
        Field(
            description='Whether the current governance reporting period remains actionable. Closure is not final billing.'
        ),
    ] = None
    check_count: Annotated[
        SchemaInt, Field(description='Number of governance checks performed for this action.')
    ]
    seller_reference: Annotated[
        str | None,
        Field(
            description="The seller's identifier for the resource (e.g., media_buy_id, rights_grant_id). Present when reported via report_plan_outcome."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var adjustments_reported : float | None
var adjustments_verified : float | None
var buyer_observed_spend : float | None
var check_count : int
var committed : float
var conservative_exposure : float | None
var delivery_period_state : DeliveryPeriodState | None
var delivery_reconciliation_status : DeliveryReconciliationStatus | None
var delivery_reporting_period : DeliveryReportingPeriod | None
var governance_context : str
var headroom_restored : float | None
var model_config
var net_committed : float | None
var net_cost : float | None
var purchase_type : PurchaseType
var seller_reference : str | None
var seller_reported_spend : float | None
var status : Status

Inherited members

class Issuer (**data: Any)
Expand source code
class Issuer(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    domain: Annotated[
        str,
        Field(
            description='Lowercase registrable or organizational domain used as the stable issuer identifier.',
            pattern='^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$',
        ),
    ]
    name: Annotated[str | None, Field(min_length=1)] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var domain : str
var model_config
var name : str | None

Inherited members

class MixTargets (**data: Any)
Expand source code
class MixTargets(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    min_pct: StrictFloat | None = None
    max_pct: StrictFloat | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var max_pct : float | None
var min_pct : float | None
var model_config

Inherited members

class OutcomeState (*args, **kwds)
Expand source code
class OutcomeState(StrEnum):
    accepted = 'accepted'
    findings = 'findings'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var accepted
var findings
class Pacing (*args, **kwds)
Expand source code
class Pacing(StrEnum):
    ahead = 'ahead'
    on_track = 'on_track'
    behind = 'behind'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var ahead
var behind
var on_track
class Package (**data: Any)
Expand source code
class Package(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    budget: Annotated[StrictFloat | None, Field(ge=0.0)] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var budget : float | None
var model_config

Inherited members

class PolicyCategoryDefinition (**data: Any)
Expand source code
class PolicyCategoryDefinition(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    category_id: Annotated[
        str,
        Field(
            description='Unique identifier for this category. Used in plan.policy_categories, signal-definition.policy_categories, and policy-entry.policy_categories.',
            pattern='^[a-z][a-z0-9_]*$',
        ),
    ]
    name: Annotated[
        str, Field(description="Human-readable name (e.g., 'Children-Directed Content').")
    ]
    description: Annotated[
        str,
        Field(
            description='What this category covers. Defines the boundary — what campaigns or data fall under this category.'
        ),
    ]
    facets: Annotated[
        list[Facet] | None,
        Field(
            description='Registry-defined distinctions within the category that materially affect policy applicability or seller acceptance. Facets refine a category without creating a new top-level policy category.',
            min_length=1,
        ),
    ] = None
    regulatory_frameworks: Annotated[
        list[RegulatoryFramework] | None,
        Field(
            description='Key regulations and standards grouped under this category. Governance agents use this to resolve specific policies from the registry.'
        ),
    ] = None
    restricted_attributes: Annotated[
        list[restricted_attribute.RestrictedAttribute] | None,
        Field(
            description="Restricted attribute categories that regulations in this category prohibit for targeting. Governance agents enforce these when the category is active on a plan — if a plan declares policy_categories: ['fair_housing'], the governance agent restricts targeting on these attributes."
        ),
    ] = None
    requires_human_review: Annotated[
        StrictBool | None,
        Field(
            description='When true, any plan declaring this category MUST set plan.human_review_required = true. Use for regulatory regimes that mandate human oversight under GDPR Art 22 or EU AI Act Annex III — fair_housing, fair_lending, fair_employment, pharmaceutical_advertising, and similar high-risk categories. Category-level setting applies to all policies and plans referencing it; policies can override on policy-entry.requires_human_review. Effective immediately regardless of individual policy `effective_date` fields.'
        ),
    ] = False
    industries: Annotated[
        list[str] | None,
        Field(
            description="Industries where this category commonly applies (e.g., 'pharmaceutical' for age_restricted). Governance agents MAY suggest relevant categories when a plan's brand industry matches but no policy_categories are declared."
        ),
    ] = None
    guidance: Annotated[
        str | None,
        Field(
            description='Implementation notes for governance agents. Edge cases, disambiguation, and common pitfalls.'
        ),
    ] = None
    related_categories: Annotated[
        list[str] | None,
        Field(
            description="Categories that frequently co-occur (e.g., 'children_directed' often appears with 'age_restricted')."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var category_id : str
var description : str
var facets : list[Facet] | None
var guidance : str | None
var industries : list[str] | None
var model_config
var name : str
var regulatory_frameworks : list[RegulatoryFramework] | None
var related_categories : list[str] | None
var requires_human_review : bool | None
var restricted_attributes : list[RestrictedAttribute] | None

Inherited members

class PolicyEntry (**data: Any)
Expand source code
class PolicyEntry(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    policy_id: Annotated[
        str,
        Field(
            description='Unique identifier for this policy. Registry-published ids are canonical (e.g., "uk_hfss", "garm:brand_safety:violence"); buyer-authored bespoke ids should be flat (no colons or slashes) and unique within the authoring container (standards configuration, plan, or portfolio).'
        ),
    ]
    source: Annotated[
        Source | None,
        Field(
            description="Origin of this policy. 'registry' = published to the shared AdCP policy registry with full regulatory metadata. 'inline' = authored bespoke for a specific standards configuration, plan, or portfolio. Defaults to 'inline'. Governance agents MUST set 'registry' when publishing to the registry. Within AdCP *task* payloads (every `$ref` to this schema in a request or response), the field is always 'inline' — registry entries are served by the policy registry API, not embedded in task traffic. The x-entity annotation on `policy_id` assumes the task-payload invariant; if a future task schema adopts registry-publishing, split the annotation accordingly (see issue #2685)."
        ),
    ] = Source.inline
    version: Annotated[
        str | None,
        Field(
            description='Semver version string (e.g., "1.0.0"). Incremented when policy content changes. Optional for inline bespoke policies — defaults to "1.0.0". SHOULD be provided for registry-published policies.'
        ),
    ] = None
    name: Annotated[
        str | None,
        Field(
            description='Human-readable name (e.g., "UK HFSS Restrictions"). Optional for inline bespoke policies — servers MAY default to policy_id.'
        ),
    ] = None
    description: Annotated[
        str | None, Field(description='Brief summary of what this policy covers.', max_length=500)
    ] = None
    category: Annotated[
        policy_category.PolicyCategory | None,
        Field(
            description='The nature of the obligation: regulation (legal requirement) or standard (best practice). Optional for inline bespoke policies — defaults to "standard".'
        ),
    ] = None
    enforcement: Annotated[
        policy_enforcement.PolicyEnforcementLevel,
        Field(
            description='How governance agents treat violations. Regulations are typically "must"; standards are typically "should".'
        ),
    ]
    requires_human_review: Annotated[
        StrictBool | None,
        Field(
            description='When true, plans subject to this policy MUST set plan.human_review_required = true. Use for policies that mandate human oversight of decisions affecting data subjects — e.g., GDPR Article 22 (solely automated decisions with legal or similarly significant effects) and EU AI Act Annex III high-risk categories (credit, insurance pricing, recruitment, housing allocation). Governance agents MUST escalate any plan action whose resolved policies include requires_human_review: true. Unlike `enforcement`, this flag applies as soon as the policy is resolved — it is NOT gated by `effective_date`. Art 22 GDPR and similar foundational obligations may predate an AI-Act-specific effective date; the human-review requirement fires regardless.'
        ),
    ] = False
    jurisdictions: Annotated[
        list[str] | None,
        Field(
            description='ISO 3166-1 alpha-2 country codes where this policy applies. Empty array means the policy is not jurisdiction-specific.'
        ),
    ] = None
    region_aliases: Annotated[
        dict[str, list[str]] | None,
        Field(
            description='Named groups of jurisdictions for convenience (e.g., {"EU": ["AT","BE","BG",...]}). Governance agents expand aliases when matching against a plan\'s target jurisdictions.'
        ),
    ] = None
    policy_categories: Annotated[
        list[str] | None,
        Field(
            description='Regulatory categories this policy belongs to (e.g., ["children_directed", "age_restricted"]). Used for automatic matching against a campaign plan\'s declared policy_categories. A single policy can belong to multiple categories.'
        ),
    ] = None
    channels: Annotated[
        list[channels_1.MediaChannel] | None,
        Field(
            description='Advertising channels this policy applies to. If omitted or null, the policy applies to all channels.'
        ),
    ] = None
    governance_domains: Annotated[
        list[governance_domain.GovernanceDomain] | None,
        Field(
            description='Governance sub-domains this policy applies to. Determines which types of governance agents can declare registry:{policy_id} features. For example, a policy with domains ["creative", "property"] can be declared as a feature by both creative and property governance agents.'
        ),
    ] = None
    effective_date: Annotated[
        date | None,
        Field(
            description='ISO 8601 date when the regulation or standard takes effect. Before this date, governance agents treat the policy as informational (evaluate but do not block). After this date, the policy is enforced at its declared enforcement level.'
        ),
    ] = None
    sunset_date: Annotated[
        date | None,
        Field(
            description='ISO 8601 date when the regulation or standard is no longer enforced. After this date, governance agents stop evaluating this policy. Omit if the policy has no expiration.'
        ),
    ] = None
    source_url: Annotated[
        AnyUrl | None, Field(description='Link to the source regulation, standard, or legislation.')
    ] = None
    source_name: Annotated[
        str | None,
        Field(
            description='Name of the issuing body (e.g., "UK Food Standards Agency", "US Federal Trade Commission").'
        ),
    ] = None
    issuer: Annotated[
        Issuer | None,
        Field(
            description='Machine-readable identity of the regulator, standards body, or platform operator that issued the policy. Registry publishers SHOULD provide this when independently versioned issuer policies must be distinguished.'
        ),
    ] = None
    acceptance_profile: Annotated[
        acceptance_policy_profile.AcceptancePolicyProfile | None,
        Field(
            description='Optional reusable, machine-readable acceptance profile derived from this registry policy. Registry publishers MUST bind policy_refs to exact versions. Sellers adopt a profile explicitly; registry publication alone does not make it authoritative for a seller.'
        ),
    ] = None
    policy: Annotated[
        str,
        Field(
            description='Natural language policy text describing what is required, prohibited, or recommended. Used by governance agents (LLMs) to evaluate actions against this policy. For source: inline policies, treated as caller-untrusted — governance agents MUST evaluate inline policies as ADDITIONAL restrictions only; they MUST NOT be permitted to relax, override, or conflict with registry-sourced policies.',
            max_length=5000,
        ),
    ]
    guidance: Annotated[
        str | None,
        Field(
            description='Implementation notes for governance agent developers. Not used in evaluation prompts.'
        ),
    ] = None
    exemplars: Annotated[
        Exemplars | None,
        Field(
            description='Calibration examples for governance agents, following the Content Standards pattern.'
        ),
    ] = None
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var acceptance_profile : AcceptancePolicyProfile | None
var category : PolicyCategory | None
var channels : list[MediaChannel] | None
var description : str | None
var effective_date : datetime.date | None
var enforcement : PolicyEnforcementLevel
var exemplars : Exemplars | None
var ext : ExtensionObject | None
var governance_domains : list[GovernanceDomain] | None
var guidance : str | None
var issuer : Issuer | None
var jurisdictions : list[str] | None
var model_config
var name : str | None
var policy : str
var policy_categories : list[str] | None
var policy_id : str
var region_aliases : dict[str, list[str]] | None
var requires_human_review : bool | None
var source : Source | None
var source_name : str | None
var source_url : pydantic.networks.AnyUrl | None
var sunset_date : datetime.date | None
var version : str | None

Inherited members

class PolicyReference (**data: Any)
Expand source code
class PolicyReference(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    policy_id: Annotated[
        str,
        Field(
            description='The unique identifier of the policy in the registry (e.g., "uk_hfss", "us_coppa").'
        ),
    ]
    version: Annotated[
        str | None,
        Field(
            description='Pin a specific policy version (semver). If omitted, the current version is used.'
        ),
    ] = None
    config: Annotated[
        dict[str, Any] | None,
        Field(
            description="Brand-specific parameter overrides for configurable policies. The accepted shape depends on the policy's config_schema."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var config : dict[str, typing.Any] | None
var model_config
var policy_id : str
var version : str | None

Inherited members

class Portfolio (**data: Any)
Expand source code
class Portfolio(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    member_plan_ids: Annotated[
        list[str],
        Field(
            description='Plan IDs governed by this portfolio plan. The governance agent validates member plan actions against portfolio constraints.'
        ),
    ]
    total_budget_cap: Annotated[
        TotalBudgetCap | None,
        Field(description='Maximum aggregate budget across all member plans.'),
    ] = None
    shared_policy_ids: Annotated[
        list[str] | None,
        Field(
            description='Registry policy IDs enforced across all member plans, regardless of individual brand configuration.'
        ),
    ] = None
    shared_exclusions: Annotated[
        list[policy_entry.PolicyEntry] | None,
        Field(
            description="Bespoke exclusion policies applied across all member plans, using the same shape as registry entries. Authored typically as enforcement: must policies with exclusion language in the policy text (e.g., 'No advertising on properties owned by competitor holding companies')."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var member_plan_ids : list[str]
var model_config
var shared_exclusions : list[PolicyEntry] | None
var shared_policy_ids : list[str] | None
var total_budget_cap : TotalBudgetCap | None

Inherited members

class ProposedCommitment (**data: Any)
Expand source code
class ProposedCommitment(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    amount: Annotated[StrictFloat, Field(ge=0.0)]
    currency: Annotated[str, Field(pattern='^[A-Z]{3}$')]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var amount : float
var currency : str
var model_config

Inherited members

class Recovery (*args, **kwds)
Expand source code
class Recovery(StrEnum):
    transient = 'transient'
    correctable = 'correctable'
    terminal = 'terminal'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var correctable
var terminal
var transient
class RegulatoryBasi (**data: Any)
Expand source code
class RegulatoryBasi(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: Annotated[str, Field(description="Name of the regulation (e.g., 'GDPR Article 9(1)').")]
    jurisdictions: Annotated[
        list[str] | None,
        Field(description='ISO 3166-1 alpha-2 codes where this regulation applies.'),
    ] = None
    summary: Annotated[
        str, Field(description='How this regulation defines or restricts the attribute.')
    ]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var jurisdictions : list[str] | None
var model_config
var name : str
var summary : str

Inherited members

class RegulatoryFramework (**data: Any)
Expand source code
class RegulatoryFramework(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: Annotated[
        str, Field(description="Name of the regulation or standard (e.g., 'US COPPA').")
    ]
    jurisdictions: Annotated[
        list[str] | None,
        Field(description='ISO 3166-1 alpha-2 codes where this framework applies.'),
    ] = None
    summary: Annotated[
        str, Field(description='Brief summary of what the framework requires or prohibits.')
    ]
    policy_ids: Annotated[
        list[str] | None, Field(description='Registry policy IDs that implement this framework.')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var jurisdictions : list[str] | None
var model_config
var name : str
var policy_ids : list[str] | None
var summary : str

Inherited members

class ReportPlanAdjustmentRequest (**data: Any)
Expand source code
class ReportPlanAdjustmentRequest(AdcpRequest, AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    action: Annotated[
        Action,
        Field(
            description='report is seller-authenticated and creates a non-authoritative record; review is plan-owner-authenticated and accepts or disputes it.'
        ),
    ]
    plan_id: Annotated[str, Field(description='Plan containing the source outcome.', min_length=1)]
    outcome_id: Annotated[
        str | None,
        Field(
            description='Completed outcome whose authoritative commitment is being adjusted.',
            min_length=1,
        ),
    ] = None
    adjustment_id: Annotated[
        str | None, Field(description='Adjustment to accept or dispute. Required for review.')
    ] = None
    decision: Annotated[
        Decision | None,
        Field(
            description='Buyer review decision. Acceptance is blocked while delivery evidence for the governed action is disputed in an open governance period; a historical closed_unresolved period is audit evidence, not a billing determination.'
        ),
    ] = None
    seller_reference: Annotated[
        str | None,
        Field(
            description='Seller resource identifier. Must exactly match the reference retained on the source outcome.',
            max_length=255,
            min_length=1,
        ),
    ] = None
    seller_adjustment_id: Annotated[
        str | None,
        Field(
            description="Stable identifier of the adjustment in the authenticated seller's system.",
            max_length=255,
            min_length=1,
        ),
    ] = None
    adjustment_type: Annotated[
        AdjustmentType | None,
        Field(
            description='Commercial meaning. Verified decommitments restore headroom in every mode; verified refunds and credits restore it only in verified_net_cost mode; makegoods never restore cash headroom.'
        ),
    ] = None
    amount: Annotated[
        Amount | None, Field(description='Positive adjustment amount in the plan currency.')
    ] = None
    reason: Annotated[
        str | None,
        Field(
            description='Human-readable reason retained in the audit trail.',
            max_length=1000,
            min_length=1,
        ),
    ] = None
    effective_at: Annotated[
        AwareDatetime | None, Field(description="When the seller's adjustment became effective.")
    ] = None
    evidence: Annotated[
        Evidence | None,
        Field(
            description='Integrity-bound commercial source record supplied by the seller. Its evidence_type must correspond to adjustment_type.'
        ),
    ] = None
    idempotency_key: Annotated[
        str,
        Field(
            description='Caller-generated retry key. Exact replays return the original report or review; reuse with another payload is rejected.',
            max_length=255,
            min_length=16,
            pattern='^[A-Za-z0-9_.:-]{16,255}$',
        ),
    ]
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The request message of a task in the pinned bundle's task registry.

A consumer holding one can resolve its account, decide at-most-once, echo its context and negotiate version – the whole transport-boundary job – before knowing which tool it is. issubclass(model, AdcpRequest) is the registration-time proof that a model is spec-derived rather than a hand-written parallel: a field test passes for a forged model, descent does not.

Each accessor returns the field's value, or None when this tool's schema declares no such field. Only 49 of the 87 request schemas declare an account and only 43 an idempotency_key, so asking the request is what replaces getattr(req, "account", None) against Any at the boundary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var action : Action
var adjustment_id : str | None
var adjustment_type : AdjustmentType | None
var amount : Amount | None
var context : ContextObject | None
var decision : Decision | None
var effective_at : pydantic.types.AwareDatetime | None
var evidence : Evidence | None
var ext : ExtensionObject | None
var idempotency_key : str
var model_config
var outcome_id : str | None
var plan_id : str
var reason : str | None
var seller_adjustment_id : str | None
var seller_reference : str | None

Inherited members

class ReportPlanAdjustmentResponse (**data: Any)
Expand source code
class ReportPlanAdjustmentResponse(AdcpResponse, AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    adjustment_id: Annotated[
        str, Field(description='Governance-agent identifier for the adjustment record.')
    ]
    adjustment_state: Annotated[
        AdjustmentState,
        Field(
            description='reported has seller evidence but no buyer decision; verified was accepted by the plan owner; disputed was rejected by the plan owner. Only verified records can affect net cost or headroom.'
        ),
    ]
    adjustment_type: AdjustmentType
    amount: Amount
    headroom_restored: Annotated[
        StrictFloat,
        Field(
            description='Amount by which current ledger commitment was reduced under the plan accounting mode.',
            ge=0.0,
        ),
    ]
    plan_summary: PlanSummary
    replayed: Annotated[
        StrictBool | None,
        Field(
            description="Set to true when this response was returned from the idempotency cache rather than from a fresh execution. Set to false (or omitted) when the request was executed fresh. Buyers use this to distinguish cached replays from new executions — matters for billing reconciliation, audit logs, state-machine routing (cached state-tracking fields are historical snapshots, not current state — re-read via the resource's read endpoint), and any downstream system that assumes exactly-once event semantics. `replayed` appears only when the request actually resolved through the idempotency cache. Pure reads may ignore an optional `idempotency_key`; when a seller voluntarily caches keyed reads, those responses use the same replay indicator and full cache contract."
        ),
    ] = False
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The response message of a task in the pinned bundle's task registry.

A consumer holding one can route on task state, pick up an async task_id, split envelope from payload and log uniformly, before knowing which tool answered. Which makes one generic poll-to-terminal loop possible for all 77 tasks, where today each arm has no common type at all.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var adjustment_id : str
var adjustment_state : AdjustmentState
var adjustment_type : AdjustmentType
var amount : Amount
var context : ContextObject | None
var ext : ExtensionObject | None
var headroom_restored : float
var model_config
var plan_summary : PlanSummary
var replayed : bool | None

Inherited members

class ReportPlanOutcomeRequest (**data: Any)
Expand source code
class ReportPlanOutcomeRequest(AdcpRequest, AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    plan_id: Annotated[
        str,
        Field(
            description='The plan this outcome is for. The plan is owned by the authenticated buyer that synchronized it; plan_id is an identifier, not an account credential. Completed and failed settlements inherit their commercial binding from the exact approved check tuple.'
        ),
    ]
    check_id: Annotated[
        str | None,
        Field(
            description='The check_id from check_governance. Required for completed and failed outcomes and for buyer delivery observations. A delivery observation names the exact seller delivery check whose canonical statement is being compared.'
        ),
    ] = None
    idempotency_key: Annotated[
        str,
        Field(
            description='Buyer-generated unique key for this outcome report. An identical retry returns the cached response without another settlement; reuse with a different canonical payload returns IDEMPOTENCY_CONFLICT. Use a fresh UUID v4 for each distinct report.',
            max_length=255,
            min_length=16,
            pattern='^[A-Za-z0-9_.:-]{16,255}$',
        ),
    ]
    purchase_type: Annotated[
        purchase_type_1.PurchaseType | None,
        Field(
            description="The type of financial commitment this outcome is for. Must equal the original approved intent's purchase_type. Determines which budget allocation (if any) to charge against. Defaults to 'media_buy' when omitted."
        ),
    ] = purchase_type_1.PurchaseType.media_buy
    outcome: Annotated[outcome_type.OutcomeType, Field(description='Outcome type.')]
    seller_response: Annotated[
        SellerResponse | None,
        Field(description="The seller's full response. Required when outcome is 'completed'."),
    ] = None
    delivery: Annotated[
        Delivery | None,
        Field(
            description='Buyer-attributed observation compared with the canonical seller delivery statement identified by check_id. This evidence never overwrites seller evidence or creates a second commitment. A conflict produces an explicit disputed reconciliation state while the operational period is open; the plan owner may close it without asserting final billing truth.'
        ),
    ] = None
    error: Annotated[
        reported_outcome_error.ReportedOutcomeError | None,
        Field(
            description='Buyer-attributed error associated with a failed seller interaction. Required when outcome is failed; classification_source=seller_response_copy preserves what the buyer received without claiming seller-attested provenance.'
        ),
    ] = None
    governance_context: Annotated[
        str | None,
        Field(
            description='Opaque governance context from the check_governance response. Required with check_id for completed and failed outcomes and buyer delivery observations.',
            max_length=4096,
            min_length=1,
            pattern='^[\\x20-\\x7E]+$',
        ),
    ] = None
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The request message of a task in the pinned bundle's task registry.

A consumer holding one can resolve its account, decide at-most-once, echo its context and negotiate version – the whole transport-boundary job – before knowing which tool it is. issubclass(model, AdcpRequest) is the registration-time proof that a model is spec-derived rather than a hand-written parallel: a field test passes for a forged model, descent does not.

Each accessor returns the field's value, or None when this tool's schema declares no such field. Only 49 of the 87 request schemas declare an account and only 43 an idempotency_key, so asking the request is what replaces getattr(req, "account", None) against Any at the boundary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var check_id : str | None
var context : ContextObject | None
var delivery : Delivery | None
var error : ReportedOutcomeError | None
var ext : ExtensionObject | None
var governance_context : str | None
var idempotency_key : str
var model_config
var outcome : OutcomeType
var plan_id : str
var purchase_type : PurchaseType | None
var seller_response : SellerResponse | None

Inherited members

class ReportPlanOutcomeResponse (**data: Any)
Expand source code
class ReportPlanOutcomeResponse(AdcpResponse, AdcpVersionEnvelope):
    @model_validator(mode='before')
    @classmethod
    def _status_to_outcome_state(cls, data: Any) -> Any:
        if isinstance(data, dict) and 'outcome_state' not in data and 'status' in data:
            data = dict(data)
            data['outcome_state'] = data['status']
        return data

    model_config = ConfigDict(
        extra='allow',
    )
    outcome_id: Annotated[str, Field(description='Unique identifier for this outcome record.')]
    outcome_state: Annotated[
        OutcomeState,
        Field(
            description="Outcome state. 'accepted' means state updated with no issues. 'findings' means issues were detected. Renamed from `status` in 3.1 to free the top-level `status` key for the envelope task-status (TaskStatus) under MCP flat-on-the-wire serialization."
        ),
    ]
    committed_budget: Annotated[
        StrictFloat | None,
        Field(
            description="Budget committed from this outcome. Present for 'completed' and 'failed' outcomes."
        ),
    ] = None
    delivery_reconciliation_status: Annotated[
        DeliveryReconciliationStatus | None,
        Field(
            description='Comparison state between the buyer-attributed observation and canonical seller statement. Present for delivery outcomes. A disputed state blocks adjustment verification while the period is open. measurement_variance records a buyer-measured cumulative_spend that differs from the seller statement; it never blocks verification — the higher amount bounds conservative exposure and decommitments instead. closed_unresolved preserves the discrepancy after operational closure without claiming a final billing result.'
        ),
    ] = None
    delivery_period_state: Annotated[
        DeliveryPeriodState | None,
        Field(
            description='Operational state of the governance reporting period. Closure freezes governance evidence for that period but is not billing settlement.'
        ),
    ] = None
    findings: Annotated[
        list[Finding] | None,
        Field(description="Issues detected. Present only when outcome_state is 'findings'."),
    ] = None
    plan_summary: Annotated[
        PlanSummary | None,
        Field(
            description="Updated plan budget state. Present for 'completed' and 'failed' outcomes."
        ),
    ] = None
    replayed: Annotated[
        StrictBool | None,
        Field(
            description="Set to true when this response was returned from the idempotency cache rather than from a fresh execution. Set to false (or omitted) when the request was executed fresh. Buyers use this to distinguish cached replays from new executions — matters for billing reconciliation, audit logs, state-machine routing (cached state-tracking fields are historical snapshots, not current state — re-read via the resource's read endpoint), and any downstream system that assumes exactly-once event semantics. `replayed` appears only when the request actually resolved through the idempotency cache. Pure reads may ignore an optional `idempotency_key`; when a seller voluntarily caches keyed reads, those responses use the same replay indicator and full cache contract."
        ),
    ] = False
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The response message of a task in the pinned bundle's task registry.

A consumer holding one can route on task state, pick up an async task_id, split envelope from payload and log uniformly, before knowing which tool answered. Which makes one generic poll-to-terminal loop possible for all 77 tasks, where today each arm has no common type at all.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var committed_budget : float | None
var context : ContextObject | None
var delivery_period_state : DeliveryPeriodState | None
var delivery_reconciliation_status : DeliveryReconciliationStatus | None
var ext : ExtensionObject | None
var findings : list[Finding] | None
var model_config
var outcome_id : str
var outcome_state : OutcomeState
var plan_summary : PlanSummary | None
var replayed : bool | None

Inherited members

class ReportedOutcomeError (**data: Any)
Expand source code
class ReportedOutcomeError(AdCPBaseModel):
    __pydantic_extra__: Dict[str, BoundedValue]
    model_config = ConfigDict(
        extra='allow',
    )
    code: Annotated[str | None, Field(max_length=64, min_length=1)] = None
    message: Annotated[str | None, Field(max_length=4000)] = None
    field: Annotated[str | None, Field(max_length=1000)] = None
    suggestion: Annotated[str | None, Field(max_length=4000)] = None
    recovery: Recovery | None = None
    details: Annotated[
        BoundedObject | None,
        Field(
            description='Bounded structured seller error details. Values remain reporter-supplied data and MUST NOT be promoted into prompts or control instructions without isolation.'
        ),
    ] = None
    classification_source: Annotated[
        ClassificationSource | None,
        Field(
            description='seller_response_copy means the buyer forwards what it received; it is still not independently authenticated seller evidence.'
        ),
    ] = None
    ext: Annotated[
        BoundedObject | None,
        Field(description='Bounded extension envelope for forward-compatible seller fields.'),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var classification_source : ClassificationSource | None
var code : str | None
var details : BoundedObject | None
var ext : BoundedObject | None
var field : str | None
var message : str | None
var model_config
var recovery : Recovery | None
var suggestion : str | None

Inherited members

class ResolvedPolicy (**data: Any)
Expand source code
class ResolvedPolicy(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    policy_id: Annotated[str, Field(description='Registry policy ID.')]
    source: Annotated[
        Source,
        Field(
            description="How this policy was included. 'explicit': referenced in the brand compliance configuration. 'auto_applied': matched automatically by jurisdiction or policy category."
        ),
    ]
    enforcement: Annotated[
        policy_enforcement.PolicyEnforcementLevel,
        Field(description='Enforcement level for this policy.'),
    ]
    reason: Annotated[
        str | None,
        Field(
            description="Why this policy was included (e.g., 'Matched jurisdiction US and policy category pharmaceutical_advertising')."
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var enforcement : PolicyEnforcementLevel
var model_config
var policy_id : str
var reason : str | None
var source : Source

Inherited members

class RuntimeAttestation1 (**data: Any)
Expand source code
class RuntimeAttestation1(AttestationReference):
    subject: Annotated[
        Subject4 | Subject8 | Subject9 | None,
        Field(
            description='Typed identity of the entity or object an attestation credential is about. Brand and agent subjects reuse canonical AdCP identities. Other resources use an open, URI-namespaced resource_type plus an identifier whose namespace is explicit. Evaluators MUST compare the resolved credential subject to this complete typed identity, not to id alone.',
            discriminator='type',
            examples=[
                {
                    'type': 'brand',
                    'brand': {'domain': 'nova-brands.example', 'brand_id': 'nova_motors'},
                },
                {
                    'type': 'resource',
                    'resource_type': 'https://adcontextprotocol.org/claims/subjects/signal',
                    'namespace': 'https://signals.meridian.example/adcp',
                    'id': 'signal_urban_commuters',
                },
            ],
            title='Attestation Subject',
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config
var subject : Subject4 | Subject8 | Subject9 | None

Inherited members

class RuntimeAttestationEvaluation (**data: Any)
Expand source code
class RuntimeAttestationEvaluation(AttestationEvaluation):
    action_binding: Annotated[
        ActionBinding,
        Field(
            description='Optional binding to the consuming action or readback. Domain consumers that rely on an evaluation MUST carry either an action id or an action digest so the result cannot be transplanted to an unrelated decision.'
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var action_binding : ActionBinding
var model_config

Inherited members

class SellerResponse (**data: Any)
Expand source code
class SellerResponse(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    seller_reference: Annotated[
        str | None,
        Field(
            description="The seller's identifier for the created resource (e.g., media_buy_id, rights_grant_id, deployment_id). Not interpreted by the governance agent — included in audit logs for human-readable traceability alongside the opaque governance_context.",
            max_length=255,
        ),
    ] = None
    committed_budget: Annotated[
        StrictFloat | None,
        Field(
            description='Buyer-reported seller amount retained for reconciliation and audit. It is never ledger authority: the governance agent derives the reserved commitment from its own approved intent check, or from the matching purchase execution check when one exists. A report above that authorized amount is rejected; a lower report does not restore headroom.',
            ge=0.0,
        ),
    ] = None
    packages: Annotated[
        list[Package] | None,
        Field(description='Confirmed packages with actual budget and targeting.'),
    ] = None
    planned_delivery: Annotated[
        planned_delivery_1.PlannedDelivery | None,
        Field(
            description="What the seller said it will deliver. When seller-side governance is not configured, this is the governance agent's only view of the seller's delivery parameters."
        ),
    ] = None
    creative_deadline: Annotated[
        AwareDatetime | None, Field(description='ISO 8601 deadline for creative submission.')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var committed_budget : float | None
var creative_deadline : pydantic.types.AwareDatetime | None
var model_config
var packages : list[Package] | None
var planned_delivery : PlannedDelivery | None
var seller_reference : str | None

Inherited members

class Status51 (*args, **kwds)
Expand source code
class Status51(StrEnum):
    active = 'active'
    inactive = 'inactive'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var active
var inactive
class Statuses (**data: Any)
Expand source code
class Statuses(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    approved: SchemaInt | None = None
    denied: SchemaInt | None = None
    conditions: SchemaInt | None = None
    human_reviewed: Annotated[
        SchemaInt | None,
        Field(
            description='Supplementary count of checks that went through internal human review. These checks are also counted in approved or denied.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var approved : int | None
var conditions : int | None
var denied : int | None
var human_reviewed : int | None
var model_config

Inherited members

class Subject (**data: Any)
Expand source code
class Subject(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    type: Literal['agent'] = 'agent'
    resource_type: Literal['https://adcontextprotocol.org/claims/subjects/signal'] = 'https://adcontextprotocol.org/claims/subjects/signal'
    agent_url: Annotated[
        AnyUrl, Field(description='Canonical HTTPS endpoint of the agent the claim concerns.')
    ]
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var agent_url : pydantic.networks.AnyUrl
var ext : ExtensionObject | None
var model_config
var resource_type : Literal['https://adcontextprotocol.org/claims/subjects/signal']
var type : Literal['agent']

Inherited members

class Subject4 (**data: Any)
Expand source code
class Subject4(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    type: Literal['brand'] = 'brand'
    resource_type: Literal['https://adcontextprotocol.org/claims/subjects/signal'] = 'https://adcontextprotocol.org/claims/subjects/signal'
    brand: brand_ref.BrandReference
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var brand : BrandReference
var ext : ExtensionObject | None
var model_config
var resource_type : Literal['https://adcontextprotocol.org/claims/subjects/signal']
var type : Literal['brand']

Inherited members

class Subject6 (**data: Any)
Expand source code
class Subject6(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    type: Literal['resource'] = 'resource'
    resource_type: Annotated[
        Literal['https://adcontextprotocol.org/claims/subjects/signal'],
        Field(
            description='Open, absolute URI naming the subject vocabulary, such as https://adcontextprotocol.org/claims/subjects/signal. AdCP does not maintain an exhaustive enum.'
        ),
    ] = 'https://adcontextprotocol.org/claims/subjects/signal'
    namespace: Annotated[
        AnyUrl,
        Field(
            description='Absolute URI identifying the namespace in which id is unique. This may be an AdCP agent endpoint, a catalog origin, or a domain-specific namespace URI.'
        ),
    ]
    id: Annotated[
        str,
        Field(
            description='Stable identifier for the subject within namespace. It MUST NOT be compared without resource_type and namespace.',
            max_length=1024,
            min_length=1,
        ),
    ]
    content_digest: Annotated[
        str | None,
        Field(
            description='Optional SHA-256 pin for the exact content or immutable snapshot identified by this resource subject. This is part of the complete typed subject identity and is distinct from AttestationReference.content_digest, which pins credential bytes.',
            pattern='^sha256:[a-f0-9]{64}$',
        ),
    ] = None
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var content_digest : str | None
var ext : ExtensionObject | None
var id : str
var model_config
var namespace : pydantic.networks.AnyUrl
var resource_type : Literal['https://adcontextprotocol.org/claims/subjects/signal']
var type : Literal['resource']

Inherited members

class Subject8 (**data: Any)
Expand source code
class Subject8(Subject):
    type: Literal['agent'] = 'agent'

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config
var type : Literal['agent']

Inherited members

class Subject9 (**data: Any)
Expand source code
class Subject9(Subject6):
    type: Literal['resource'] = 'resource'

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config
var type : Literal['resource']

Inherited members

class Summary (**data: Any)
Expand source code
class Summary(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    checks_performed: Annotated[
        SchemaInt | None, Field(description='Total governance checks performed.')
    ] = None
    outcomes_reported: Annotated[
        SchemaInt | None, Field(description='Total outcomes reported.')
    ] = None
    adjustments_reported: Annotated[
        SchemaInt | None, Field(description='Total append-only adjustment records reported.')
    ] = None
    adjustments_verified: Annotated[
        SchemaInt | None,
        Field(
            description='Count of adjustment records accepted by the plan owner, including makegoods.'
        ),
    ] = None
    statuses: Annotated[
        Statuses | None, Field(description='Count of each governance check status.')
    ] = None
    findings_count: Annotated[
        SchemaInt | None, Field(description='Total findings across all checks and outcomes.')
    ] = None
    escalations: Annotated[
        list[Escalation] | None, Field(description='All escalations and their resolutions.')
    ] = None
    drift_metrics: Annotated[
        DriftMetrics | None,
        Field(
            description='Aggregate governance metrics for detecting oversight drift. A declining escalation rate may indicate well-calibrated governance or eroding human oversight -- surfacing the trend lets the organization make that judgment.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var adjustments_reported : int | None
var adjustments_verified : int | None
var checks_performed : int | None
var drift_metrics : DriftMetrics | None
var escalations : list[Escalation] | None
var findings_count : int | None
var model_config
var outcomes_reported : int | None
var statuses : Statuses | None

Inherited members

class SyncPlansRequest (**data: Any)
Expand source code
class SyncPlansRequest(AdcpRequest, AdcpVersionEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    idempotency_key: Annotated[
        str,
        Field(
            description='Client-generated unique key for at-most-once execution. `plan_id` gives resource-level dedup per plan, but the sync envelope emits audit events and can trigger governance reapproval — this key prevents those side effects from firing twice on retry. MUST be unique per (seller, request) pair. Use a fresh UUID v4 for each request.',
            max_length=255,
            min_length=16,
            pattern='^[A-Za-z0-9_.:-]{16,255}$',
        ),
    ]
    plans: Annotated[list[Plan], Field(description='One or more campaign plans to sync.')]
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The request message of a task in the pinned bundle's task registry.

A consumer holding one can resolve its account, decide at-most-once, echo its context and negotiate version – the whole transport-boundary job – before knowing which tool it is. issubclass(model, AdcpRequest) is the registration-time proof that a model is spec-derived rather than a hand-written parallel: a field test passes for a forged model, descent does not.

Each accessor returns the field's value, or None when this tool's schema declares no such field. Only 49 of the 87 request schemas declare an account and only 43 an idempotency_key, so asking the request is what replaces getattr(req, "account", None) against Any at the boundary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var context : ContextObject | None
var ext : ExtensionObject | None
var idempotency_key : str
var model_config
var plans : list[Plan]

Inherited members

class SyncPlansResponse (**data: Any)
Expand source code
class SyncPlansResponse(AdcpResponse, AdcpVersionEnvelope, ProtocolEnvelope):
    model_config = ConfigDict(
        extra='allow',
    )
    plans: Annotated[list[Plan], Field(description='Status for each synced plan.')]
    replayed: Annotated[
        StrictBool | None,
        Field(
            description="Set to true when this response was returned from the idempotency cache rather than from a fresh execution. Set to false (or omitted) when the request was executed fresh. Buyers use this to distinguish cached replays from new executions — matters for billing reconciliation, audit logs, state-machine routing (cached state-tracking fields are historical snapshots, not current state — re-read via the resource's read endpoint), and any downstream system that assumes exactly-once event semantics. `replayed` appears only when the request actually resolved through the idempotency cache. Pure reads may ignore an optional `idempotency_key`; when a seller voluntarily caches keyed reads, those responses use the same replay indicator and full cache contract."
        ),
    ] = False
    context: context_1.ContextObject | None = None
    ext: ext_1.ExtensionObject | None = None

The response message of a task in the pinned bundle's task registry.

A consumer holding one can route on task state, pick up an async task_id, split envelope from payload and log uniformly, before knowing which tool answered. Which makes one generic poll-to-terminal loop possible for all 77 tasks, where today each arm has no common type at all.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var context : ContextObject | None
var ext : ExtensionObject | None
var model_config
var plans : list[Plan]
var replayed : bool | None

Inherited members

class Thresholds (**data: Any)
Expand source code
class Thresholds(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    escalation_rate_max: Annotated[
        StrictFloat | None,
        Field(
            description='Maximum acceptable escalation rate. A rate above this suggests policy miscalibration.',
            ge=0.0,
            le=1.0,
        ),
    ] = None
    escalation_rate_min: Annotated[
        StrictFloat | None,
        Field(
            description='Minimum acceptable escalation rate. A rate below this may indicate eroding oversight.',
            ge=0.0,
            le=1.0,
        ),
    ] = None
    auto_approval_rate_max: Annotated[
        StrictFloat | None,
        Field(description='Maximum acceptable auto-approval rate.', ge=0.0, le=1.0),
    ] = None
    human_override_rate_max: Annotated[
        StrictFloat | None,
        Field(
            description="Maximum acceptable human override rate. A high rate suggests the governance agent's recommendations are poorly calibrated.",
            ge=0.0,
            le=1.0,
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var auto_approval_rate_max : float | None
var escalation_rate_max : float | None
var escalation_rate_min : float | None
var human_override_rate_max : float | None
var model_config

Inherited members

class TotalBudgetCap (**data: Any)
Expand source code
class TotalBudgetCap(BudgetLimit):
    pass

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config

Inherited members

class Type (*args, **kwds)
Expand source code
class Type(StrEnum):
    check = 'check'
    outcome = 'outcome'
    adjustment = 'adjustment'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var adjustment
var check
var outcome
class VerificationMode (*args, **kwds)
Expand source code
class VerificationMode(StrEnum):
    spec = 'spec'
    live = 'live'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var live
var spec