Register a loan application review playground agent instance with demo span schemas
const url = 'https://app.prefactorai.com/api/v1/playground/register_loan_application_review_agent_instance';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '"013xrzp12g3nqk8ns6jadrqmpgrjkeny"'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.prefactorai.com/api/v1/playground/register_loan_application_review_agent_instance \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '"013xrzp12g3nqk8ns6jadrqmpgrjkeny"'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”A valid agent ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyResponses
Section titled “Responses”Success
object
object
A valid account ID
A valid agent ID
Map of alert schema names to their schemas and optional title, description, template and data_risk
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Schema name (key)
JSON schema for the payload. Title and description are sibling fields on this object and are not present inside schema.
object
Human-readable title (defaults to name)
Agent deployments whose current version uses this schema version (empty if none).
External identifier for the agent schema version
Count of rows sharing this external identifier (helps distinguish duplicates).
A valid agent schema version ID
When the agent schema version was created
Map of quality schema names to their schemas and optional title, description, template and data_risk
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Schema name (key)
JSON schema for the payload. Title and description are sibling fields on this object and are not present inside schema.
object
Human-readable title (defaults to name)
Map of span type names to their params and result JSON schemas
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Span type name
JSON schema for the span payload
object
JSON schema for the span result payload (defaults to empty object if omitted when creating)
object
Human-readable title (defaults to name)
Type of resource (always ‘agent_schema_version’)
When the agent schema version was last updated
object
A valid account ID
A valid agent ID
A valid agent schema version ID
Agent deployments that pin this version as their current version (empty if none).
External identifier for the agent version
Count of rows sharing this external identifier (helps distinguish duplicates).
A valid agent version ID
When the agent version was created
object
List of package name and version strings (e.g. “package@1.0.0”)
Null
List of package name and version strings (e.g. “package@1.0.0”)
Null
Null
Type of resource (always ‘agent_version’)
When the agent version was last updated
object
A valid account ID
A valid agent deployment ID
A valid agent ID
A valid agent version ID
object
Total cache-read tokens across all models
Per-model breakdown
object
Total cache-read tokens for this model
Total input tokens for this model
Model identifier from span payloads
Total output tokens for this model
Total input tokens across all models
Total output tokens across all models
Null
A valid environment ID
A valid agent instance ID
When the agent instance was created
Why this instance ran: ‘live’ for an actual agent run, ‘smoke_test’ for a pipeline check, or ‘eval’ for an evaluation run
Map of quality schema name to evaluation payload for this instance
object
object
Map of quality schema name to rendered summary (only names whose template renders)
object
Human-readable quality summary rendered from the quality schema template using the matching quality payload
object
Unique included data categories across params and results of span types that ran, in canonical order
Actions allowed by at least one span type that ran in this instance, in canonical order
Whether the instance has at least one span type with scoreable data_risk
Critical threshold from the agent’s risk profile ruleset
Per-schema-type score breakdown
object
Number of span invocations for this schema type
Risk level bucket for this schema type’s per-invocation score
Span type schema name
Type_score multiplied by count
Risk score for a single invocation of this schema type
Total risk score across all span types for this instance
Null
object
Number of spans with status active (running)
Number of spans with status cancelled
Number of spans with status complete
Number of spans with status failed
Number of spans in a finished state (complete + failed + cancelled)
Number of spans with status pending
Total number of agent spans
object
Invocation count keyed by span schema name
object
Null
Status of the agent instance: ‘pending’ (not started yet), ‘active’ (started but not finished), ‘complete’ (finished successfully), ‘failed’ (ended with failure), ‘cancelled’ (never started, cancelled), or ‘terminated’ (externally terminated)
Type of resource (always ‘agent_instance’)
When the agent instance was last updated
Example
{ "agent_schema_version": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "alert_schemas": { "additionalProperty": { "data_risk": { "action_profile": { "create_data": "unknown", "destroy_data": "unknown", "external_communication": "unknown", "financial_transactions": "unknown", "read_data": "unknown", "update_data": "unknown" }, "params_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" }, "result_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" } }, "description": null, "schema_validation": { "message": null, "status": "success" }, "template": null } }, "current_agent_deployment_refs": [ "013xrzp12g3nqk8ns6jadrqmpgrjkeny" ], "external_identifier": "v0", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "quality_schemas": { "additionalProperty": { "data_risk": { "action_profile": { "create_data": "unknown", "destroy_data": "unknown", "external_communication": "unknown", "financial_transactions": "unknown", "read_data": "unknown", "update_data": "unknown" }, "params_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" }, "result_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" } }, "description": null, "schema_validation": { "message": null, "status": "success" }, "template": null } }, "span_type_schemas": { "llm": { "name": "llm", "params_schema": { "properties": { "max_tokens": { "type": "integer" }, "model": { "type": "string" }, "temperature": { "type": "number" } }, "type": "object" }, "result_schema": { "properties": { "tokens": { "type": "integer" } }, "type": "object" } }, "tool": { "name": "tool", "params_schema": { "properties": { "input": { "type": "object" }, "name": { "type": "string" } }, "type": "object" }, "result_schema": { "additionalProperties": false, "type": "object" } } }, "type": "agent_schema_version", "updated_at": "2024-01-01T00:00:00Z" }, "agent_version": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_schema_version_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "current_agent_deployment_refs": [ "013xrzp12g3nqk8ns6jadrqmpgrjkeny" ], "external_identifier": "v1.0.0", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "runtime_environment": null, "type": "agent_version", "updated_at": "2024-01-01T00:00:00Z" }, "details": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_deployment_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_version_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "cost_breakdown": null, "environment_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "finished_at": "2024-01-01T00:00:00Z", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "last_activity_span_at": "2024-01-01T00:00:00Z", "purpose": "live", "raised_alert_count": null, "risk_score": null, "span_counts": { "active": 2, "cancelled": 0, "complete": 5, "failed": 0, "finished": 5, "pending": 0, "total": 10 }, "span_schema_counts": null, "started_at": "2024-01-01T00:00:00Z", "status": "pending", "termination_reason": "User requested termination", "type": "agent_instance", "updated_at": "2024-01-01T00:00:00Z" }, "status": "success"}default
Section titled “default”Error