IF Commons GitHub

sql/typed/models/identity-agent.auto

The typed tables of the identityAgent model, generated by IFC Data from the model. Do not edit: change the model and run bun tools/typed.ts --write.

AI agents: provenance, tools, runs, budgets and approvals

Source: commons/data/sql/typed/models/identity-agent.auto.ts

0 of 32 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

identityAgentnamespace
namespace identityAgent
identityAgent.AgentRowinterfaceno test imports it
interface AgentRow

A program that decides for itself what to do, accountable to an owner and limited by its level of autonomy

MemberTypeWhat it is
principalIdstringThe principal the agent is
autonomy"act_with_approval" | "autonomous" | "observe" | "suggest"How much it may do without a person
purposestringWhat it is for
frameworkstring | nullWhat it is built with
frameworkVersionstring | nullThe version of what it is built with
providerstring | nullWho runs it
cardUrlstring | nullWhere its agent card is published
approvalThreshold"critical" | "high" | "low" | "medium"The risk at or above which its calls need an approval
maxDelegationDepthnumberHow many delegations deep it may act
maxConcurrentRunsnumber | nullHow many runs it may have at once
sponsorPrincipalIdstring | nullWho answers for its business use, where that is not its owner
identityAgent.AgentInsertinterfaceno test imports it
interface AgentInsert

What an insert into agent takes: what the database fills may be left out.

MemberTypeWhat it is
principalIdstring
autonomy"act_with_approval" | "autonomous" | "observe" | "suggest"
purposestring
framework?string | null
frameworkVersion?string | null
provider?string | null
cardUrl?string | null
approvalThreshold"critical" | "high" | "low" | "medium"
maxDelegationDepthnumber
maxConcurrentRuns?number | null
sponsorPrincipalId?string | null
identityAgent.AgentKeytypeno test imports it
type AgentKey = { readonly principalId: string };

The key of a row of agent.

identityAgent.agentconstno test imports it
const agent: Table<AgentRow, AgentInsert, "agent">

A program that decides for itself what to do, accountable to an owner and limited by its level of autonomy

identityAgent.AgentVersionRowinterfaceno test imports it
interface AgentVersionRow

A version of an agent: which model, which prompt and which tools, pinned, so that a bad one can be pulled from every run

MemberTypeWhat it is
agentVersionIdstringWhat identifies the version, made by the application
versionLabelstringWhat the version is called, unique for its agent
modelProviderstringWho makes the model
modelNamestringThe model
modelVersionstringThe pinned snapshot of the model, never an alias that moves
promptHashstringA hash of the system prompt; the prompt is not kept here
toolManifestHashstringA hash of the tools it is given
codeRefstring | nullThe commit of its code
status"active" | "approved" | "candidate" | "retired" | "revoked"Where the version is
approvedAtTimestamp | nullWhen it was approved
createdAtTimestampWhen it was made
versionKeystringA hash of the agent and the label, unique
agentPrincipalIdstringThe agent
approvedByPrincipalIdstring | nullWho approved it
identityAgent.AgentVersionInsertinterfaceno test imports it
interface AgentVersionInsert

What an insert into agent_version takes: what the database fills may be left out.

MemberTypeWhat it is
agentVersionIdstring
versionLabelstring
modelProviderstring
modelNamestring
modelVersionstring
promptHashstring
toolManifestHashstring
codeRef?string | null
status"active" | "approved" | "candidate" | "retired" | "revoked"
approvedAt?Timestamp | null
createdAtTimestamp
versionKeystring
agentPrincipalIdstring
approvedByPrincipalId?string | null
identityAgent.AgentVersionKeytypeno test imports it
type AgentVersionKey = { readonly agentVersionId: string };

The key of a row of agent_version.

identityAgent.agentVersionconstno test imports it
const agentVersion: Table<AgentVersionRow, AgentVersionInsert, "agentVersion">

A version of an agent: which model, which prompt and which tools, pinned, so that a bad one can be pulled from every run

identityAgent.AgentToolRowinterfaceno test imports it
interface AgentToolRow

A tool that agents may be granted: what it is called, the permission a call needs, how risky it is

MemberTypeWhat it is
agentToolIdstringWhat identifies the tool, made by the application
namestringWhat the tool is called, unique within its tenant
definitionstringWhat it does
serverAudiencestring | nullThe server or API it is on
riskLevel"critical" | "high" | "low" | "medium"How much harm it can do
sideEffect"external" | "irreversible" | "none" | "read" | "write"What it does
argsSchemaHashstring | nullA hash of the schema of its arguments
status"active" | "retired"Whether it is in use
tenantIdstring | nullThe tenant it is for; empty for the platform's
permissionIdstringThe permission a call needs: one path for tools, APIs and screens
identityAgent.AgentToolInsertinterfaceno test imports it
interface AgentToolInsert

What an insert into agent_tool takes: what the database fills may be left out.

MemberTypeWhat it is
agentToolIdstring
namestring
definitionstring
serverAudience?string | null
riskLevel"critical" | "high" | "low" | "medium"
sideEffect"external" | "irreversible" | "none" | "read" | "write"
argsSchemaHash?string | null
status"active" | "retired"
tenantId?string | null
permissionIdstring
identityAgent.AgentToolKeytypeno test imports it
type AgentToolKey = { readonly agentToolId: string };

The key of a row of agent_tool.

identityAgent.agentToolconstno test imports it
const agentTool: Table<AgentToolRow, AgentToolInsert, "agentTool">

A tool that agents may be granted: what it is called, the permission a call needs, how risky it is

identityAgent.ToolGrantRowinterfaceno test imports it
interface ToolGrantRow

A tool that an agent has been granted, perhaps with a condition on its calls, never more than the agent's owner may do

MemberTypeWhat it is
agentPrincipalIdstringThe agent
toolAgentToolIdstringThe tool
expressionstring | nullA condition on a call, over its arguments
approval"always" | "inherit"Whether a call needs approval
maxCallsPerRunnumber | nullHow many calls a run may make
validToTimestamp | nullWhen the grant ends
status"active" | "retired"Whether the grant is applied
grantedByPrincipalIdstringWho granted it
identityAgent.ToolGrantInsertinterfaceno test imports it
interface ToolGrantInsert

What an insert into tool_grant takes: what the database fills may be left out.

MemberTypeWhat it is
agentPrincipalIdstring
toolAgentToolIdstring
expression?string | null
approval"always" | "inherit"
maxCallsPerRun?number | null
validTo?Timestamp | null
status"active" | "retired"
grantedByPrincipalIdstring
identityAgent.ToolGrantKeytypeno test imports it
type ToolGrantKey = { readonly agentPrincipalId: string; readonly toolAgentToolId: string };

The key of a row of tool_grant.

identityAgent.toolGrantconstno test imports it
const toolGrant: Table<ToolGrantRow, ToolGrantInsert, "toolGrant">

A tool that an agent has been granted, perhaps with a condition on its calls, never more than the agent's owner may do

identityAgent.AgentRunRowinterfaceno test imports it
interface AgentRunRow

One task of an agent, in one version, perhaps under a delegation, perhaps started by another run

MemberTypeWhat it is
runIdstringWhat identifies the run, made by the application
startedAtTimestampWhen it started
endedAtTimestamp | nullWhen it ended
status"cancelled" | "expired" | "failed" | "killed" | "running" | "succeeded"Where it is
traceIdstring | nullThe trace it is part of
purposestring | nullWhat it is for
inputHashstring | nullA hash of its input
agentPrincipalIdstringThe agent
versionAgentVersionIdstringThe version it runs
tenantIdstringThe tenant it runs in
initiatorPrincipalIdstring | nullWho started it
delegationIdstring | nullThe delegation it acts under
parentRunAgentRunRunIdstring | nullThe run that started it, for a sub-agent
identityAgent.AgentRunInsertinterfaceno test imports it
interface AgentRunInsert

What an insert into agent_run takes: what the database fills may be left out.

MemberTypeWhat it is
runIdstring
startedAtTimestamp
endedAt?Timestamp | null
status"cancelled" | "expired" | "failed" | "killed" | "running" | "succeeded"
traceId?string | null
purpose?string | null
inputHash?string | null
agentPrincipalIdstring
versionAgentVersionIdstring
tenantIdstring
initiatorPrincipalId?string | null
delegationId?string | null
parentRunAgentRunRunId?string | null
identityAgent.AgentRunKeytypeno test imports it
type AgentRunKey = { readonly runId: string };

The key of a row of agent_run.

identityAgent.agentRunconstno test imports it
const agentRun: Table<AgentRunRow, AgentRunInsert, "agentRun">

One task of an agent, in one version, perhaps under a delegation, perhaps started by another run

identityAgent.ToolCallRowinterfaceno test imports it
interface ToolCallRow

A call of a tool in a run: what was decided, and a hash of its arguments, never the arguments

MemberTypeWhat it is
toolCallIdstringWhat identifies the call, made by the application
callIndexnumberWhich call of the run it is
decision"allowed" | "approval_required" | "budget_exceeded" | "denied"What was decided about it
status"failed" | "requested" | "running" | "succeeded"Where it is
argsHashstringA hash of its arguments
argsSummarystring | nullWhat it asked for, redacted by the caller, never the raw arguments
resourceTypestring | nullThe kind of resource it was about
resourceIdstring | nullThe resource it was about
resultHashstring | nullA hash of its result
denyReasonstring | nullWhy it was refused
policyRefsunknownThe roles, policies and grants that decided
tokensInnumber | nullTokens sent to the model
tokensOutnumber | nullTokens received from the model
costMicrosnumber | nullWhat it cost, in millionths of a currency unit
requestedAtTimestampWhen it was asked for
completedAtTimestamp | nullWhen it ended
callKeystringA hash of the run and the index, unique
runAgentRunRunIdstringThe run
toolAgentToolIdstringThe tool
approvalApprovalRequestIdstring | nullThe approval it was given
identityAgent.ToolCallInsertinterfaceno test imports it
interface ToolCallInsert

What an insert into tool_call takes: what the database fills may be left out.

MemberTypeWhat it is
toolCallIdstring
callIndexnumber
decision"allowed" | "approval_required" | "budget_exceeded" | "denied"
status"failed" | "requested" | "running" | "succeeded"
argsHashstring
argsSummary?string | null
resourceType?string | null
resourceId?string | null
resultHash?string | null
denyReason?string | null
policyRefs?unknown
tokensIn?number | null
tokensOut?number | null
costMicros?number | null
requestedAtTimestamp
completedAt?Timestamp | null
callKeystring
runAgentRunRunIdstring
toolAgentToolIdstring
approvalApprovalRequestId?string | null
identityAgent.ToolCallKeytypeno test imports it
type ToolCallKey = { readonly toolCallId: string };

The key of a row of tool_call.

identityAgent.toolCallconstno test imports it
const toolCall: Table<ToolCallRow, ToolCallInsert, "toolCall">

A call of a tool in a run: what was decided, and a hash of its arguments, never the arguments

identityAgent.AgentBudgetRowinterfaceno test imports it
interface AgentBudgetRow

What an agent, under a delegation or in a run, may spend of a meter in a window; it cannot be exceeded

MemberTypeWhat it is
budgetIdstringWhat identifies the budget, made by the application
meter"cost_micros" | "tokens" | "tool_calls" | "writes"What it counts
windowKind"day" | "hour" | "lifetime" | "month" | "run"How long it lasts
limitValuenumberHow much may be spent
usednumberHow much has been
windowStartTimestampWhen the window began
versionnumberWhich update it has had, so that two updates cannot both win
status"active" | "retired"Whether the budget is applied
budgetKeystringA hash of the agent, the delegation, the run, the meter and the window, unique
agentPrincipalIdstringThe agent
delegationIdstring | nullThe delegation it is for
runAgentRunRunIdstring | nullThe run it is for
identityAgent.AgentBudgetInsertinterfaceno test imports it
interface AgentBudgetInsert

What an insert into agent_budget takes: what the database fills may be left out.

MemberTypeWhat it is
budgetIdstring
meter"cost_micros" | "tokens" | "tool_calls" | "writes"
windowKind"day" | "hour" | "lifetime" | "month" | "run"
limitValuenumber
usednumber
windowStartTimestamp
versionnumber
status"active" | "retired"
budgetKeystring
agentPrincipalIdstring
delegationId?string | null
runAgentRunRunId?string | null
identityAgent.AgentBudgetKeytypeno test imports it
type AgentBudgetKey = { readonly budgetId: string };

The key of a row of agent_budget.

identityAgent.agentBudgetconstno test imports it
const agentBudget: Table<AgentBudgetRow, AgentBudgetInsert, "agentBudget">

What an agent, under a delegation or in a run, may spend of a meter in a window; it cannot be exceeded

identityAgent.ApprovalRequestRowinterfaceno test imports it
interface ApprovalRequestRow

A request for a person to approve one action of an agent, bound to a hash of its arguments, usable once

MemberTypeWhat it is
approvalRequestIdstringWhat identifies the request, made by the application
actionKeystringThe permission the action needs
resourceTypestring | nullThe kind of resource it is about
resourceIdstring | nullThe resource it is about
argsHashstringA hash of the arguments, so that an approval is for exactly this call
summarystringWhat will happen, redacted
riskLevel"critical" | "high" | "low" | "medium"How risky it is
approverRule"delegator" | "owner" | "role_holder"Who may approve
status"approved" | "cancelled" | "consumed" | "denied" | "expired" | "pending"Where the request is
requestedAtTimestampWhen it was asked for
expiresAtTimestampWhen it stops being valid
decidedAtTimestamp | nullWhen it was decided
decisionReasonstring | nullWhy it was decided so
consumedAtTimestamp | nullWhen it was used
runAgentRunRunIdstringThe run
agentPrincipalIdstringThe agent that asks
approverRoleAccessRoleRoleIdstring | nullThe role whose holders may approve, where the rule says so
decidedByPrincipalIdstring | nullThe person who decided
identityAgent.ApprovalRequestInsertinterfaceno test imports it
interface ApprovalRequestInsert

What an insert into approval_request takes: what the database fills may be left out.

MemberTypeWhat it is
approvalRequestIdstring
actionKeystring
resourceType?string | null
resourceId?string | null
argsHashstring
summarystring
riskLevel"critical" | "high" | "low" | "medium"
approverRule"delegator" | "owner" | "role_holder"
status"approved" | "cancelled" | "consumed" | "denied" | "expired" | "pending"
requestedAtTimestamp
expiresAtTimestamp
decidedAt?Timestamp | null
decisionReason?string | null
consumedAt?Timestamp | null
runAgentRunRunIdstring
agentPrincipalIdstring
approverRoleAccessRoleRoleId?string | null
decidedByPrincipalId?string | null
identityAgent.ApprovalRequestKeytypeno test imports it
type ApprovalRequestKey = { readonly approvalRequestId: string };

The key of a row of approval_request.

identityAgent.approvalRequestconstno test imports it
const approvalRequest: Table<ApprovalRequestRow, ApprovalRequestInsert, "approvalRequest">

A request for a person to approve one action of an agent, bound to a hash of its arguments, usable once

Titles, headings, exports, tables, columns and requirements. Esc closes.