cx-ai-center

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Center Skill

AI Center Skill

This is the tool for anything about AI/GenAI applications — both questions about their behavior (prompts/responses, quality, hallucinations, guardrails, security, cost/tokens, errors, latency — everything AI apps expose through their GenAI spans/tags) and actions to manage them (applications, evaluations/policies, policy↔app links, model pricing). If a request touches an AI application or its GenAI telemetry, use this skill.
Coralogix AI Center observes, evaluates, and guards GenAI/LLM applications. This skill answers questions about AI apps from two sources:
  • Configuration (this skill's
    cx ai-center
    commands): the AI application inventory, configured evaluations/policies, coverage, custom evaluations, and model pricing — none of which live in span telemetry.
  • Telemetry (GenAI spans): what users asked, how the model answered, cost, tokens, latency, errors, tool calls, and eval/guardrail verdicts — queried with
    cx spans '<DataPrime>'
    . See references/ai-center-queries.md for the full, runnable query library, span schema, and playbooks.
Match the source to the question: "which apps lack guardrails" → config (
cx ai-center applications list
); "what are users asking my chatbot" → telemetry (
cx spans '…'
, reading the conversation from the GenAI spans). Some questions need both — e.g. "is my chatbot's PII policy actually catching PII?" joins config (is the policy enabled) with telemetry (the PII verdicts + the messages).

这是处理所有AI/GenAI应用相关事务的工具 —— 既可以回答关于AI应用行为的问题(提示词/响应、质量、幻觉、防护机制、安全性、成本/令牌、错误、延迟等所有AI应用通过GenAI spans/tags暴露的信息),也可以执行管理操作(应用程序、评估/策略、策略与应用关联、模型定价)。如果请求涉及AI应用或其GenAI遥测数据,请使用此Skill。
Coralogix AI Center用于观测、评估和防护GenAI/LLM应用。此Skill从两个来源获取AI应用相关问题的答案:
  • 配置信息(通过此Skill的
    cx ai-center
    命令):AI应用清单、已配置的评估/策略、覆盖范围、自定义评估以及模型定价 —— 这些信息均不存储在遥测链路数据中。
  • 遥测数据(GenAI spans):用户的提问内容、模型的回答内容、成本、令牌、延迟、错误、工具调用以及评估/防护判定结果 —— 通过**
    cx spans '<DataPrime>'
    **查询。完整的可运行查询库、链路数据 schema 和操作手册,请查看references/ai-center-queries.md
根据问题类型匹配对应数据源:例如“哪些应用未启用防护机制”→ 配置信息(
cx ai-center applications list
);“用户向我的聊天机器人提出了哪些问题”→ 遥测数据(
cx spans '…'
,从GenAI spans中读取对话内容)。部分问题需要同时使用两种数据源 —— 例如“我的聊天机器人的PII策略是否真的能识别出PII?”需要结合配置信息(策略是否启用)和遥测数据(PII判定结果+对话消息)。

Destructive Operation Safety

破坏性操作安全规范

All write operations (
create
,
update
,
delete
,
add
,
remove
,
set
) require interactive confirmation.
ai-center
is a risky command, so writes are also gated by
allow_risky_commands
in
~/.cx/config.toml
. To skip the prompt in scripts, pass
--yes
.
IMPORTANT: NEVER pass
--yes
without explicit user approval.
Before executing any write:
  1. Describe the exact operation to the user (what will be created/modified/deleted/linked).
  2. Wait for the user to confirm.
  3. Only then execute with
    --yes
    .
Read operations (
list
,
get
,
coverage
,
list-for-application
,
model-pricing get
) do not require confirmation and can be run freely.
所有写入操作(
create
update
delete
add
remove
set
)均需要交互式确认。
ai-center
属于高风险命令,因此写入操作还受
~/.cx/config.toml
中的
allow_risky_commands
配置限制。若要在脚本中跳过确认提示,请添加
--yes
参数。
**重要提示:未经用户明确批准,切勿使用
--yes
参数。**执行任何写入操作前:
  1. 向用户描述具体操作内容(将创建/修改/删除/关联的对象)。
  2. 等待用户确认。
  3. 获得确认后,再添加
    --yes
    参数执行操作。
读取操作(
list
get
coverage
list-for-application
model-pricing get
)无需确认,可直接执行。

Read-Only Mode

只读模式

Use
--read-only
(or
CX_READ_ONLY=1
) to block every write at the CLI level — safe for exploration.
使用
--read-only
(或
CX_READ_ONLY=1
)参数可在CLI层面阻止所有写入操作 —— 适合用于探索性操作。

Agent Mode

Agent模式

When running inside an AI agent (Claude Code, Cursor, Codex, …), cx detects it and — instead of showing a confirmation prompt that would hang forever (no human is there to type y/n) — stops immediately with an error telling you to get the user's approval, then re-run with
--yes
.
当在AI Agent(Claude Code、Cursor、Codex等)内部运行时,cx会自动检测环境,不会显示会导致程序挂起的确认提示(没有人工输入y/n),而是立即终止并抛出错误,提示你获取用户批准后,添加
--yes
参数重新执行。

No delete commands (by design)

无删除命令(设计如此)

The CLI intentionally exposes no delete for custom-evaluation policies, AI applications, or model pricing — even though the AI v3 API has those delete endpoints,
cx ai-center
does not surface them.
  • Custom-evaluation policy: can't be deleted; to take it off an app, detach with
    custom-evaluations remove
    (the policy object survives and can be re-attached).
  • Model pricing: no delete command. It's team-wide (not per-app), so to change or clear it, run
    model-pricing set
    with a new map (an empty map
    {}
    clears all overrides) —
    set
    replaces the whole set.

CLI刻意不提供自定义评估策略、AI应用或模型定价的删除命令 —— 尽管AI v3 API包含这些删除端点,但
cx ai-center
并未开放。
  • 自定义评估策略:无法删除;若要从应用中移除,使用
    custom-evaluations remove
    命令解除关联(策略对象会保留,可重新关联)。
  • 模型定价:无删除命令。它是团队级配置(而非应用级),若要修改或清空配置,使用
    model-pricing set
    命令传入新的映射表(空映射表
    {}
    会清除所有覆盖配置)——
    set
    命令会替换整个配置集合。

Golden rule

黄金准则

For content questions (quality, hallucination, sentiment, topics) read the actual conversation and cite the
traceID
— don't rely on verdict tags alone. The transcript lives in one of two conventions (
gen_ai.input.messages
/
output.messages
, or the older indexed
gen_ai.prompt.<n>
/
completion.<n>
tags); read it with the Reading conversations (content questions) queries in the library, which handle both and exclude the system prompt and tool traffic. Full guidance: references/ai-center-queries.md.

对于内容类问题(质量、幻觉、情感、主题),请读取实际对话内容并引用
traceID
—— 不要仅依赖判定标签。对话内容存储在两种约定格式中(
gen_ai.input.messages
/
output.messages
,或旧版索引格式
gen_ai.prompt.<n>
/
completion.<n>
标签);可使用查询库中的「读取对话内容(内容类问题)」查询语句,该语句会兼容两种格式并排除系统提示词和工具流量。完整指南请查看:references/ai-center-queries.md

CLI Commands

CLI命令

Show names to the user; use UUIDs only internally. When presenting results, refer to apps and evaluations by their human names (application/subsystem, evaluation name), not raw UUIDs. The UUID is only needed to call a by-id or write command — resolve it yourself from the matching
list
command (never guess or make the user paste a UUID).
**向用户展示名称;仅在内部使用UUID。**展示结果时,请使用应用和评估的人类可读名称(应用/子系统、评估名称),而非原始UUID。仅在调用按ID查询或写入命令时才需要UUID —— 请通过对应的
list
命令自行获取(切勿猜测或让用户粘贴UUID)。

Applications (inventory + guarded status)

应用程序(清单与防护状态)

CommandPurpose
cx ai-center applications list
List AI apps incl.
guardrailsIntegrated
(guarded) status
cx ai-center applications list --evaluation-type <TYPE>
Filter to apps using an eval type (repeatable)
cx ai-center applications list --page-size <N> --page-offset <N>
Paginate
cx ai-center applications get <application-id>
One application by UUID
命令用途
cx ai-center applications list
列出所有AI应用,包含
guardrailsIntegrated
(已启用防护)状态
cx ai-center applications list --evaluation-type <TYPE>
筛选使用指定评估类型的应用(可重复使用该参数)
cx ai-center applications list --page-size <N> --page-offset <N>
分页查询
cx ai-center applications get <application-id>
通过UUID查询单个应用

Evaluations (configured policies on apps)

评估(应用上配置的策略)

CommandPurpose
cx ai-center evaluations list
All configured evaluations
cx ai-center evaluations list --application <app> --subsystem <sub>
Scope to one app (the pair)
cx ai-center evaluations list --evaluation-type <TYPE>
Filter by type —
<TYPE>
is the API enum (e.g.
PII
,
TOXICITY
,
PROMPT_INJECTION
; the keys from
coverage
), not the lowercase form
cx ai-center evaluations get <evaluation-id>
One evaluation by UUID
cx ai-center evaluations create --from-file eval.json
Create/enable an evaluation (write)
cx ai-center evaluations update <evaluation-id> --from-file patch.json
Partial update (write)
cx ai-center evaluations delete <evaluation-id>
Remove an evaluation from its app (write)
命令用途
cx ai-center evaluations list
查询所有已配置的评估
cx ai-center evaluations list --application <app> --subsystem <sub>
限定查询范围为单个应用(应用+子系统组合)
cx ai-center evaluations list --evaluation-type <TYPE>
按类型筛选 ——
<TYPE>
为API枚举值(例如
PII
TOXICITY
PROMPT_INJECTION
;即
coverage
命令返回的键值),不支持小写形式
cx ai-center evaluations get <evaluation-id>
通过UUID查询单个评估
cx ai-center evaluations create --from-file eval.json
创建/启用评估(写入操作)
cx ai-center evaluations update <evaluation-id> --from-file patch.json
部分更新(写入操作)
cx ai-center evaluations delete <evaluation-id>
从应用中移除评估(写入操作)

Custom evaluations (policies) & application links

自定义评估(策略)与应用关联

CommandPurpose
cx ai-center custom-evaluations list
All custom evaluation policies
cx ai-center custom-evaluations list-for-application <application-id>
Policies linked to one app
cx ai-center custom-evaluations create --from-file policy.json
Create a custom policy (write)
cx ai-center custom-evaluations update <id> --from-file patch.json
Partial update (write)
cx ai-center custom-evaluations add <evaluation-id> <application-id>
Attach a policy to an app (write)
cx ai-center custom-evaluations remove <evaluation-id> <application-id>
Detach (reversible) (write)
By-id is prebuilt-only.
evaluations get <id>
fetches a prebuilt/configured evaluation. Custom policies have no get-by-id — find one via
custom-evaluations list
/
list-for-application
and match by
id
/name.
命令用途
cx ai-center custom-evaluations list
查询所有自定义评估策略
cx ai-center custom-evaluations list-for-application <application-id>
查询与指定应用关联的策略
cx ai-center custom-evaluations create --from-file policy.json
创建自定义策略(写入操作)
cx ai-center custom-evaluations update <id> --from-file patch.json
部分更新(写入操作)
cx ai-center custom-evaluations add <evaluation-id> <application-id>
将策略关联到应用(写入操作)
cx ai-center custom-evaluations remove <evaluation-id> <application-id>
解除关联(可恢复)(写入操作)
仅预构建评估支持按ID查询。
evaluations get <id>
用于查询预构建/已配置的评估。自定义策略不支持按ID查询 —— 请通过
custom-evaluations list
/
list-for-application
命令查询,并通过
id
/名称匹配。

Coverage & model pricing

覆盖范围与模型定价

CommandPurpose
cx ai-center coverage
Map of each evaluation type → number of apps using it (coverage / gap analysis)
cx ai-center model-pricing get
Team's custom per-model pricing overrides
cx ai-center model-pricing set --from-file prices.json
Set team pricing (team-wide, new data only) (write)
The
--from-file
bodies for
evaluations
and
custom-evaluations
match the AI v3 API shape verbatim; use
-
to read JSON from stdin. For
evaluations create
,
target
is required and must be uppercase (
PROMPT
or
RESPONSE
); for
custom-evaluations create
,
name
,
instructions
, and
policyType
are required. Exception:
model-pricing set
takes just the raw
model→price
map — cx wraps it as
{"prices": …}
for you, so do not include the outer
prices
envelope. Each model maps to a price object; all four fields are optional doubles (USD per one million tokens), omit the ones that don't apply:
json
{
  "gpt-4o": {
    "inputPricePerMillionTokens": 2.5,
    "outputPricePerMillionTokens": 10,
    "cacheReadPricePerMillionTokens": 1.25,
    "cacheWritePricePerMillionTokens": 3.75
  }
}
An empty map
{}
clears all overrides (set replaces the whole set — it's team-wide, new data only).
model-pricing get
returns the wrapper
{ "pricing": { "id", "companyId", "prices": { … } } }
— the per-model overrides live under
prices
(empty when none are set).

命令用途
cx ai-center coverage
生成各评估类型→使用该类型的应用数量的映射表(覆盖范围/缺口分析)
cx ai-center model-pricing get
查询团队的自定义模型定价覆盖配置
cx ai-center model-pricing set --from-file prices.json
设置团队定价(团队级配置,仅使用新数据)(写入操作)
evaluations
custom-evaluations
命令的
--from-file
参数对应的JSON结构与AI v3 API完全一致;可使用
-
从标准输入读取JSON。对于
evaluations create
命令,
target
必填项且必须大写(
PROMPT
RESPONSE
);对于
custom-evaluations create
命令,
name
instructions
policyType
为必填项。例外情况:
model-pricing set
仅接受原始的
模型→价格
映射表 —— cx会自动将其包装为
{"prices": …}
,因此请勿包含外层的
prices
包裹结构。每个模型对应一个价格对象,四个字段均为可选的浮点数(单位为每一百万令牌的美元价格),可忽略不适用的字段:
json
{
  "gpt-4o": {
    "inputPricePerMillionTokens": 2.5,
    "outputPricePerMillionTokens": 10,
    "cacheReadPricePerMillionTokens": 1.25,
    "cacheWritePricePerMillionTokens": 3.75
  }
}
空映射表
{}
会清除所有覆盖配置(
set
命令会替换整个配置集合 —— 这是团队级配置,仅使用新数据)。
model-pricing get
命令返回的结构为
{ "pricing": { "id", "companyId", "prices": { … } } }
—— 模型级覆盖配置位于
prices
字段下(无配置时为空)。

Common workflows

常见工作流

Inventory & guardrail gaps

清单与防护缺口

bash
undefined
bash
undefined

Which apps are NOT guarded?

哪些应用未启用防护?

cx ai-center applications list -o json | jq '[.[] | select(.guardrailsIntegrated==false)]'
undefined
cx ai-center applications list -o json | jq '[.[] | select(.guardrailsIntegrated==false)]'
undefined

Enable a policy on an app (write — confirm first!)

为应用启用策略(写入操作 —— 请先确认!)

bash
undefined
bash
undefined

1. Describe to the user; 2. get approval; 3. then:

1. 向用户描述操作内容;2. 获取批准;3. 执行以下命令:

cx ai-center evaluations create --from-file eval.json --yes
cx ai-center evaluations create --from-file eval.json --yes

eval.json: { "application": "...", "subsystem": "...", "target": "PROMPT", "config": { "<type>": {...} }, "isEnabled": true }

eval.json示例: { "application": "...", "subsystem": "...", "target": "PROMPT", "config": { "<type>": {...} }, "isEnabled": true }

target
is REQUIRED and must be UPPERCASE — "PROMPT" or "RESPONSE" (the API rejects lowercase / a missing target).

target
为必填项且必须大写 —— "PROMPT"或"RESPONSE"(API会拒绝小写或缺失该字段的请求)。

undefined
undefined

Read the actual conversations (telemetry, not config)

读取实际对话内容(遥测数据,非配置信息)

Use
cx spans
with the query library in references/ai-center-queries.md — reading messages, cost, latency, errors, tool calls, and per-user analysis.

使用
cx spans
命令结合references/ai-center-queries.md中的查询库 —— 可读取消息内容、成本、延迟、错误、工具调用以及按用户维度的分析数据。

Key principles

核心原则

  • Config vs. telemetry: inventory / evaluations / policies / coverage / pricing →
    cx ai-center
    ; content / cost / latency / errors / verdicts → GenAI spans via
    cx spans
    . Don't answer one from the other.
  • Confirm before writes. Describe the operation, get approval, then run with
    --yes
    .

  • 配置信息 vs 遥测数据:清单/评估/策略/覆盖范围/定价 → 使用
    cx ai-center
    ;内容/成本/延迟/错误/判定结果 → 通过
    cx spans
    查询GenAI链路数据。请勿混淆数据源。
  • 写入操作前需确认。描述操作内容,获得用户批准后,再添加
    --yes
    参数执行。

Related Skills

相关Skill

  • cx-telemetry-querying
    — general logs/spans/metrics/DataPrime querying (the engine behind the
    cx spans
    queries used here).
  • cx-olly
    — the conversational AI assistant (
    cx olly ask
    ).
  • cx-telemetry-querying
    —— 通用日志/链路/指标/DataPrime查询工具(本Skill中
    cx spans
    查询的底层引擎)。
  • cx-olly
    —— 对话式AI助手(
    cx olly ask
    命令)。