---
title: Data model
description: How the nine platform concepts relate to each other — containment,
  lifecycle, and the connections between them.
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

```
Account
├── Environments  (one or more named delivery stages)
├── Risk profiles  (reusable, assignable to agents)
└── Agents  (one or more; each spans all environments)
    ├── Versions  (created automatically on new runs)
    ├── Activity schema  (one per agent, versioned automatically)
    │   └── Span type definitions  (payload + result per type)
    ├── Agent deployments  (one per environment; points to a version)
    └── Instances  (one per run)
        └── Spans  (one per instrumented step)
```

The [account](/platform/concepts/account) is the outer boundary. Everything in Prefactor belongs to an account — agents, environments, risk profiles, and all the runtime data they produce. Nothing crosses that boundary.

## The agent layer

[Agents](/platform/concepts/agent) belong to the account, not to any particular environment. An agent is a stable identity that persists across environments and versions.

Three further concepts describe the configuration of an agent — what version it is on, what schema governs its spans, and where it is deployed:

[Versions](/platform/concepts/agent#versions) are created automatically. When a run arrives with a combination of metadata not seen before for that agent, Prefactor creates a new version record.

The [activity schema](/platform/concepts/activity-schema) belongs to one agent and accumulates versions by the same mechanism. Each version declares the span types the agent emits and the expected shape of their payloads and results.

[Agent deployments](/platform/concepts/agent-deployment) record which version is the current release in each environment. There is at most one active deployment per agent per environment. Environments can be on different versions simultaneously.

## The runtime layer

[Environments](/platform/concepts/environment) are named stages — development, staging, production, or whatever your organisation uses. Each instance is attributed to the environment the agent reported when the run started.

An [instance](/platform/concepts/instance) is a single run from start to finish. It is stamped with the agent, the version, the activity schema version, and the environment. If the agent has a risk profile, the instance also carries the peak risk classification for that run.

[Spans](/platform/concepts/span) are the individual steps recorded within an instance. Each span has a type, a payload, a result, a duration, and a status. Spans belong to exactly one instance and are created by the SDK as the agent runs.

## The risk layer

A [risk profile](/platform/concepts/risk-profile) belongs to the account and can be assigned to any number of agents. Prefactor uses the profile's weights, multipliers, and thresholds to calculate a risk classification for every instance that agent produces. One profile can cover many agents; individual agents can each have their own.

## Further reading

- [Instrumentation strategy](/platform/instrumentation-strategy) — how instrumentation choices shape the runtime layer.
- [The audit trail](/platform/audit-trail) — how the connections between records support compliance review.