Cortex Agent 요청 모니터링

Cortex Agent는 감사 및 디버깅 목적으로 모든 대화의 자세한 추적 정보를 기록합니다. 모니터링을 사용하면 Snowflake Intelligence 또는 에이전트 API를 통해 배포된 에이전트의 대화 기록에 액세스할 수 있습니다. 대화 기록 외에도 에이전트의 계획 프로세스, 도구 선택, 실행 결과, 최종 응답 생성에 대한 자세한 추적 정보를 검토할 수 있습니다.

Cortex Agent 로그에 수집되는 정보

Cortex Agent 로그에는 다음 정보가 포함됩니다.

  • 스레드와 연결된 대화 기록

  • 다음을 포함한 범위가 있는 에이전트의 실행 추적:

    • LLM 계획

    • 도구 실행(Cortex Search, Cortex Analyst, 웹 검색)

    • LLM 응답 생성

    • SQL 실행

    • 차트 생성

  • 각 범위와 연결된 입력 및 출력

  • 각 에이전트 응답에 대한 사용자 피드백

Cortex Agent 로그에 액세스

Snowsight 에서 Cortex Agent 대화 로그를 보려면 다음을 수행합니다.

  1. Snowsight 에 로그인합니다.

  2. 탐색 메뉴에서 AI & ML » Agents 를 선택합니다.

  3. 로그를 보려는 에이전트를 선택합니다.

  4. 에이전트 뷰의 Monitoring 창으로 이동합니다.

The monitoring logs associated with the Agent are stored in the event table SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS. Entries in this table can’t be modified.

The SNOWFLAKE.AI_OBSERVABILITY_READER application role grants read-only access to query that table. It does not allow deleting rows. Administrators with the SNOWFLAKE.AI_OBSERVABILITY_ADMIN application role can delete entries in SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS. For more detail, see Observability 데이터.

참고

Unredacted fields in monitoring and UDTF results

An account-level privilege, READ UNREDACTED AI OBSERVABILITY EVENTS TABLE, controls whether roles can see unredacted content from AI_OBSERVABILITY_EVENTS (full tool inputs and outputs, full conversation text, and user feedback text) when you use Cortex Agent monitoring in Snowsight and when you call the ``SNOWFLAKE.LOCAL`` observability user-defined table functions (UDTFs) that read that event table. Without the grant, roles can still read metadata in those paths (tool names, token usage, latency, evaluation trace summaries, model name, and error severity). This does not change Cortex Agent evaluation job execution, scoring, or the Evaluations experience. An account admin must grant the privilege to see unredacted content; for details, see Account Privilege READ UNREDACTED AI OBSERVABILITY EVENTS TABLE.

Query AI Observability events with SQL

Monitoring data for an agent is stored in SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS. To read those rows programmatically, use the GET_AI_OBSERVABILITY_EVENTS table function. Pass the database name, schema name, object name, and the agent type CORTEX AGENT for a Cortex Agent or EXTERNAL AGENT for an External Agent used with AI Observability (see External Agent commands). The result has the same event table columns as the underlying table (for example RECORD, RECORD_ATTRIBUTES, VALUE, TRACE, and timestamps). You can filter with WHERE to focus on specific event kinds, time ranges, or attributes.

When agent_type is EXTERNAL AGENT, USAGE on that External Agent is sufficient to call the function; MONITOR does not apply. OWNERSHIP on the External Agent is required to modify or drop the object with SQL.

The following example returns all observability events for an agent:

SELECT *
  FROM TABLE(SNOWFLAKE.LOCAL.GET_AI_OBSERVABILITY_EVENTS(
    '<database_name>',
    '<schema_name>',
    '<agent_name>',
    'CORTEX AGENT'
  ));

For evaluation runs, warnings, and structured log lines, you can also use GET_AI_OBSERVABILITY_LOGS and the evaluation-specific functions described in Cortex Agent 평가. For how AI Observability uses the event table across products, see Observability 데이터.

사용자가 제공한 피드백 보기

End-user feedback is stored as observability events. To return only feedback events, filter on the record name CORTEX_AGENT_FEEDBACK:

SELECT *
  FROM TABLE(SNOWFLAKE.LOCAL.GET_AI_OBSERVABILITY_EVENTS(
    '<database_name>',
    '<schema_name>',
    '<agent_name>',
    'CORTEX AGENT'
  ))
  WHERE RECORD:name = 'CORTEX_AGENT_FEEDBACK';

The resulting rows include information about the agent, the user who provided feedback, the feedback text, and whether the feedback was positive or negative. For full argument and access details, see GET_AI_OBSERVABILITY_EVENTS (SNOWFLAKE.LOCAL).

액세스 제어 및 권한

A user with the ACCOUNTADMIN role can add the SNOWFLAKE.AI_OBSERVABILITY_READER application role to any role so that users can run read-only queries on SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS for Cortex Agent monitoring.

Cortex Agent 로그를 보려면 사용자에게 다음 권한이 있어야 합니다.

  • AGENT 오브젝트에 대한 OWNERSHIP 또는 MONITOR 권한

  • CORTEX_USER 데이터베이스 역할

다음 예에서는 ACCOUNTADMIN 역할을 사용하여 Cortex Agent 로그를 보기 위한 필수 권한이 있는 새 역할 ``agent_monitoring_user_role``을 만듭니다. 그런 다음, 이 새 역할을 ``some_user``에 할당합니다.

USE ROLE ACCOUNTADMIN;
CREATE ROLE agent_monitoring_user_role;
GRANT MONITOR ON AGENT my_agent TO ROLE agent_monitoring_user_role;
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE agent_monitoring_user_role;
GRANT ROLE agent_monitoring_user_role TO USER some_user;

향후 에이전트에 모니터링 액세스 권한 부여

스키마에서 생성된 향후 에이전트에 대해 역할 모니터링 액세스 권한을 부여하려면 다음 SQL 명령을 사용하세요.

GRANT MONITOR ON FUTURE AGENTS IN SCHEMA <database_name>.<schema_name> TO ROLE <role_name>;