IF Commons GitHub

agentTool

concept

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

Model identityAgent. Written in commons/data/models/identity-agent/mod.ts:81. Identified by agentToolId.

Governance: attributes

agentToolIdidentifierrequired

What identifies the tool, made by the application

Becomes the column agent_tool_id of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:84

argsSchemaHashtextoptional

A hash of the schema of its arguments

Becomes the column args_schema_hash of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:90

definitiontextrequired

What it does

Becomes the column definition of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:82

nametextrequired

What the tool is called, unique within its tenant

Becomes the column name of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:85

riskLevelcode of riskLevelrequired

How much harm it can do

Becomes the column risk_level of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:88

serverAudiencetextoptional

The server or API it is on

Becomes the column server_audience of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:87

sideEffectcode of sideEffectrequired

What it does

Becomes the column side_effect of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:89

statuscode of useStatusrequired

Whether it is in use

Becomes the column status of agent_tool.

Written at commons/data/models/identity-agent/mod.ts:91

Governance: relationships

permissionone

The permission a call needs: one path for tools, APIs and screens To permission. Written at commons/data/models/identity-agent/mod.ts:81

tenantoptional

The tenant it is for; empty for the platform's To tenant. Written at commons/data/models/identity-agent/mod.ts:129

Logical: the table

Projects to the table agent_tool with the primary key agent_tool_id.

ColumnTypeNullRoleFrom
agent_tool_idtextfalseattributeagentTool.agentToolId
args_schema_hashtexttrueattributeagentTool.argsSchemaHash
definitiontextfalseattributeagentTool.definition
nametextfalseattributeagentTool.name
permission_idtextfalsereferenceagentTool.permission
risk_leveltextfalseattributeagentTool.riskLevel
server_audiencetexttrueattributeagentTool.serverAudience
side_effecttextfalseattributeagentTool.sideEffect
statustextfalseattributeagentTool.status
tenant_idtexttruereferenceagentTool.tenant

Physical: SQL

CREATE TABLE IF NOT EXISTS "agent_tool" (
    "agent_tool_id" VARCHAR NOT NULL PRIMARY KEY,
    "name" VARCHAR NOT NULL,
    "definition" VARCHAR NOT NULL,
    "server_audience" VARCHAR,
    "risk_level" VARCHAR NOT NULL,
    "side_effect" VARCHAR NOT NULL,
    "args_schema_hash" VARCHAR,
    "status" VARCHAR NOT NULL,
    "tenant_id" VARCHAR,
    "permission_id" VARCHAR NOT NULL,
    CONSTRAINT "agent_tool_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "agent_tool_permission_id_fk" FOREIGN KEY ("permission_id") REFERENCES "permission" ("permission_id"),
    CONSTRAINT "agent_tool_name_uq" UNIQUE ("name"),
    CONSTRAINT "agent_tool_risk_level_ck" CHECK ("risk_level" IN ('low', 'medium', 'high', 'critical')),
    CONSTRAINT "agent_tool_side_effect_ck" CHECK ("side_effect" IN ('none', 'read', 'write', 'external', 'irreversible')),
    CONSTRAINT "agent_tool_status_ck" CHECK ("status" IN ('active', 'retired'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { agentTool } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-agent.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { agentTool } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(agentTool).select((s) => ({ agentToolId: s.agentTool.agentToolId, name: s.agentTool.name })).run(runner);

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