---
title: prefactor_http.models.agent_instance module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_http.models.agent_instance module

AgentInstance data models.

### *class* prefactor_http.models.agent_instance.ActionProfile(, create_data: Literal['unknown', 'allowed', 'disallowed'] = 'unknown', read_data: Literal['unknown', 'allowed', 'disallowed'] = 'unknown', update_data: Literal['unknown', 'allowed', 'disallowed'] = 'unknown', destroy_data: Literal['unknown', 'allowed', 'disallowed'] = 'unknown', financial_transactions: Literal['unknown', 'allowed', 'disallowed'] = 'unknown', external_communication: Literal['unknown', 'allowed', 'disallowed'] = 'unknown')

Bases: `BaseModel`

Action profile defining what actions a span type performs.

#### create_data

Whether this span creates data

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### read_data

Whether this span reads data

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### update_data

Whether this span updates data

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### destroy_data

Whether this span destroys data

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### financial_transactions

Whether this span performs financial transactions

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### external_communication

Whether this span sends external communications

* **Type:**
  Literal[‘unknown’, ‘allowed’, ‘disallowed’]

#### create_data *: Literal['unknown', 'allowed', 'disallowed']*

#### destroy_data *: Literal['unknown', 'allowed', 'disallowed']*

#### external_communication *: Literal['unknown', 'allowed', 'disallowed']*

#### financial_transactions *: Literal['unknown', 'allowed', 'disallowed']*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### read_data *: Literal['unknown', 'allowed', 'disallowed']*

#### update_data *: Literal['unknown', 'allowed', 'disallowed']*

### *class* prefactor_http.models.agent_instance.AgentInstance(, type: Literal['agent_instance'], id: str, account_id: str, agent_id: str, agent_version_id: str, environment_id: str, status: Literal['pending', 'active', 'complete', 'failed', 'cancelled'], inserted_at: datetime, updated_at: datetime, started_at: datetime | None = None, finished_at: datetime | None = None, span_counts: [AgentInstanceSpanCounts](#prefactor_http.models.agent_instance.AgentInstanceSpanCounts) | None = None)

Bases: `BaseModel`

Agent instance model.

#### type

Resource type (always “agent_instance”)

* **Type:**
  Literal[‘agent_instance’]

#### id

Instance ID

* **Type:**
  str

#### account_id

Account ID

* **Type:**
  str

#### agent_id

Agent ID

* **Type:**
  str

#### agent_version_id

Agent version ID

* **Type:**
  str

#### environment_id

Environment ID

* **Type:**
  str

#### status

Instance status

* **Type:**
  AgentStatus

#### inserted_at

When the instance was created

* **Type:**
  datetime

#### updated_at

When the instance was last updated

* **Type:**
  datetime

#### started_at

When the instance started (null if not started)

* **Type:**
  datetime | None

#### finished_at

When the instance finished (null if not finished)

* **Type:**
  datetime | None

#### span_counts

Span counts for this instance

* **Type:**
  [AgentInstanceSpanCounts](#prefactor_http.models.agent_instance.AgentInstanceSpanCounts) | None

#### account_id *: str*

#### agent_id *: str*

#### agent_version_id *: str*

#### environment_id *: str*

#### finished_at *: datetime | None*

#### id *: str*

#### inserted_at *: datetime*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### span_counts *: [AgentInstanceSpanCounts](#prefactor_http.models.agent_instance.AgentInstanceSpanCounts) | None*

#### started_at *: datetime | None*

#### status *: AgentStatus*

#### type *: Literal['agent_instance']*

#### updated_at *: datetime*

### *class* prefactor_http.models.agent_instance.AgentInstanceSpanCounts(, total: int, pending: int, active: int, complete: int, failed: int, cancelled: int, finished: int)

Bases: `BaseModel`

Span counts for an agent instance.

#### total

Total number of spans

* **Type:**
  int

#### pending

Number of pending spans

* **Type:**
  int

#### active

Number of active spans

* **Type:**
  int

#### complete

Number of completed spans

* **Type:**
  int

#### failed

Number of failed spans

* **Type:**
  int

#### cancelled

Number of cancelled spans

* **Type:**
  int

#### finished

Number of finished spans (complete + failed + cancelled)

* **Type:**
  int

#### active *: int*

#### cancelled *: int*

#### complete *: int*

#### failed *: int*

#### finished *: int*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### pending *: int*

#### total *: int*

### *class* prefactor_http.models.agent_instance.AgentSchemaVersionForRegister(, external_identifier: str | None = None, span_schemas: dict[str, dict] | None = None, span_result_schemas: dict[str, dict] | None = None, span_type_schemas: list[[SpanTypeSchemaForCreate](#prefactor_http.models.agent_instance.SpanTypeSchemaForCreate)] | None = None)

Bases: `BaseModel`

Schema version information for registration.

#### external_identifier

External identifier for the schema version

* **Type:**
  str | None

#### span_schemas

Map of span type names to JSON schemas

* **Type:**
  dict[str, dict] | None

#### span_result_schemas

Map of span type names to result JSON schemas

* **Type:**
  dict[str, dict] | None

#### span_type_schemas

List of span type schema details

* **Type:**
  list[[SpanTypeSchemaForCreate](#prefactor_http.models.agent_instance.SpanTypeSchemaForCreate)] | None

#### external_identifier *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### span_result_schemas *: dict[str, dict] | None*

#### span_schemas *: dict[str, dict] | None*

#### span_type_schemas *: list[[SpanTypeSchemaForCreate](#prefactor_http.models.agent_instance.SpanTypeSchemaForCreate)] | None*

### *class* prefactor_http.models.agent_instance.AgentVersionForRegister(, name: str | None = None, external_identifier: str | None = None, description: str | None = None)

Bases: `BaseModel`

Agent version information for registration.

#### name

Name of the agent version

* **Type:**
  str | None

#### external_identifier

External identifier for the version (e.g., “v1.0.0”)

* **Type:**
  str | None

#### description

Optional description of the version

* **Type:**
  str | None

#### description *: str | None*

#### external_identifier *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str | None*

### *class* prefactor_http.models.agent_instance.DataCategories(, personal_identifiers: Literal['unknown', 'included', 'excluded'] = 'unknown', contact_information: Literal['unknown', 'included', 'excluded'] = 'unknown', financial_information: Literal['unknown', 'included', 'excluded'] = 'unknown', health_and_medical: Literal['unknown', 'included', 'excluded'] = 'unknown', criminal_justice: Literal['unknown', 'included', 'excluded'] = 'unknown', authentication_and_secrets: Literal['unknown', 'included', 'excluded'] = 'unknown', organisational_confidential: Literal['unknown', 'included', 'excluded'] = 'unknown', minors_data: Literal['unknown', 'included', 'excluded'] = 'unknown', location_and_tracking: Literal['unknown', 'included', 'excluded'] = 'unknown', behavioural_and_inferred: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_racial_or_ethnic_origin: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_political_opinions: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_religious_or_philosophical_beliefs: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_trade_union_membership: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_genetic_data: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_biometric_for_identification: Literal['unknown', 'included', 'excluded'] = 'unknown', gdpr_sex_life_or_sexual_orientation: Literal['unknown', 'included', 'excluded'] = 'unknown', classification: Literal['unknown', 'public', 'internal', 'confidential', 'restricted', 'secret'] = 'unknown')

Bases: `BaseModel`

Data categories present in span data.

#### personal_identifiers

Personal identifiers present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### contact_information

Contact information present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### financial_information

Financial information present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### health_and_medical

Health and medical data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### criminal_justice

Criminal justice data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### authentication_and_secrets

Authentication and secrets present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### organisational_confidential

Organisational confidential data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### minors_data

Minors data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### location_and_tracking

Location and tracking data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### behavioural_and_inferred

Behavioural and inferred data present

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_racial_or_ethnic_origin

GDPR: racial or ethnic origin

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_political_opinions

GDPR: political opinions

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_religious_or_philosophical_beliefs

GDPR: religious or philosophical
beliefs

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_trade_union_membership

GDPR: trade union membership

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_genetic_data

GDPR: genetic data

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_biometric_for_identification

GDPR: biometric data for identification

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### gdpr_sex_life_or_sexual_orientation

GDPR: sex life or sexual orientation

* **Type:**
  Literal[‘unknown’, ‘included’, ‘excluded’]

#### classification

Classification level (unknown, public, internal,
confidential, restricted, secret)

* **Type:**
  Literal[‘unknown’, ‘public’, ‘internal’, ‘confidential’, ‘restricted’, ‘secret’]

#### authentication_and_secrets *: Literal['unknown', 'included', 'excluded']*

#### behavioural_and_inferred *: Literal['unknown', 'included', 'excluded']*

#### classification *: Literal['unknown', 'public', 'internal', 'confidential', 'restricted', 'secret']*

#### contact_information *: Literal['unknown', 'included', 'excluded']*

#### criminal_justice *: Literal['unknown', 'included', 'excluded']*

#### financial_information *: Literal['unknown', 'included', 'excluded']*

#### gdpr_biometric_for_identification *: Literal['unknown', 'included', 'excluded']*

#### gdpr_genetic_data *: Literal['unknown', 'included', 'excluded']*

#### gdpr_political_opinions *: Literal['unknown', 'included', 'excluded']*

#### gdpr_racial_or_ethnic_origin *: Literal['unknown', 'included', 'excluded']*

#### gdpr_religious_or_philosophical_beliefs *: Literal['unknown', 'included', 'excluded']*

#### gdpr_sex_life_or_sexual_orientation *: Literal['unknown', 'included', 'excluded']*

#### gdpr_trade_union_membership *: Literal['unknown', 'included', 'excluded']*

#### health_and_medical *: Literal['unknown', 'included', 'excluded']*

#### location_and_tracking *: Literal['unknown', 'included', 'excluded']*

#### minors_data *: Literal['unknown', 'included', 'excluded']*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### organisational_confidential *: Literal['unknown', 'included', 'excluded']*

#### personal_identifiers *: Literal['unknown', 'included', 'excluded']*

### *class* prefactor_http.models.agent_instance.DataRisk(, action_profile: [ActionProfile](#prefactor_http.models.agent_instance.ActionProfile), params_data_categories: [DataCategories](#prefactor_http.models.agent_instance.DataCategories), result_data_categories: [DataCategories](#prefactor_http.models.agent_instance.DataCategories), \*\*extra_data: Any)

Bases: `BaseModel`

Data risk specification for a span type.

#### action_profile

Actions this span performs

* **Type:**
  [ActionProfile](#prefactor_http.models.agent_instance.ActionProfile)

#### params_data_categories

Data categories present in params

* **Type:**
  [DataCategories](#prefactor_http.models.agent_instance.DataCategories)

#### result_data_categories

Data categories present in result

* **Type:**
  [DataCategories](#prefactor_http.models.agent_instance.DataCategories)

#### action_profile *: [ActionProfile](#prefactor_http.models.agent_instance.ActionProfile)*

#### model_config *= {'extra': 'allow'}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### params_data_categories *: [DataCategories](#prefactor_http.models.agent_instance.DataCategories)*

#### result_data_categories *: [DataCategories](#prefactor_http.models.agent_instance.DataCategories)*

### *class* prefactor_http.models.agent_instance.FinishInstanceRequest(, status: Literal['complete', 'failed', 'cancelled'] | None = None, timestamp: str | None = None, idempotency_key: str | None = None)

Bases: `BaseModel`

Request to finish an agent instance.

#### status

Optional finish status (complete, failed, cancelled)

* **Type:**
  FinishStatus | None

#### timestamp

Optional ISO 8601 timestamp (defaults to current time)

* **Type:**
  str | None

#### idempotency_key

Optional idempotency key

* **Type:**
  str | None

#### idempotency_key *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### status *: FinishStatus | None*

#### timestamp *: str | None*

### *class* prefactor_http.models.agent_instance.RegisterAgentInstanceRequest(, agent_id: str, agent_version: [AgentVersionForRegister](#prefactor_http.models.agent_instance.AgentVersionForRegister), agent_schema_version: [AgentSchemaVersionForRegister](#prefactor_http.models.agent_instance.AgentSchemaVersionForRegister), id: str | None = None, idempotency_key: str | None = None, update_current_version: bool | None = None)

Bases: `BaseModel`

Request to register a new agent instance.

#### agent_id

ID of the agent to create an instance for

* **Type:**
  str

#### agent_version

Version information for the agent

* **Type:**
  [AgentVersionForRegister](#prefactor_http.models.agent_instance.AgentVersionForRegister)

#### agent_schema_version

Schema version for the agent

* **Type:**
  [AgentSchemaVersionForRegister](#prefactor_http.models.agent_instance.AgentSchemaVersionForRegister)

#### id

Optional custom ID for the instance

* **Type:**
  str | None

#### idempotency_key

Optional idempotency key

* **Type:**
  str | None

#### update_current_version

Whether to update the current version

* **Type:**
  bool | None

#### agent_id *: str*

#### agent_schema_version *: [AgentSchemaVersionForRegister](#prefactor_http.models.agent_instance.AgentSchemaVersionForRegister)*

#### agent_version *: [AgentVersionForRegister](#prefactor_http.models.agent_instance.AgentVersionForRegister)*

#### id *: str | None*

#### idempotency_key *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### update_current_version *: bool | None*

### *class* prefactor_http.models.agent_instance.SpanTypeSchemaForCreate(, name: str, params_schema: dict, result_schema: dict | None = None, title: str | None = None, description: str | None = None, template: str | None = None, data_risk: [DataRisk](#prefactor_http.models.agent_instance.DataRisk) | None = None)

Bases: `BaseModel`

Span type schema details for registration.

#### name

Name of the span type

* **Type:**
  str

#### params_schema

JSON schema for span parameters

* **Type:**
  dict

#### result_schema

Optional JSON schema for span results

* **Type:**
  dict | None

#### title

Optional human-readable title

* **Type:**
  str | None

#### description

Optional description

* **Type:**
  str | None

#### template

Optional template string

* **Type:**
  str | None

#### data_risk

Optional data risk classification

* **Type:**
  [DataRisk](#prefactor_http.models.agent_instance.DataRisk) | None

#### data_risk *: [DataRisk](#prefactor_http.models.agent_instance.DataRisk) | None*

#### description *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str*

#### params_schema *: dict*

#### result_schema *: dict | None*

#### template *: str | None*

#### title *: str | None*

### *class* prefactor_http.models.agent_instance.TimestampRequest(, timestamp: str | None = None, idempotency_key: str | None = None)

Bases: `BaseModel`

Request with optional timestamp for start/finish operations.

#### timestamp

Optional ISO 8601 timestamp (defaults to current time)

* **Type:**
  str | None

#### idempotency_key

Optional idempotency key

* **Type:**
  str | None

#### idempotency_key *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### timestamp *: str | None*