Skip to content

feat: integrate CozeLoop tracing and prompt policy - #7

Merged
YangYuS8 merged 18 commits into
mainfrom
agent/cozeloop-observability
Jul 16, 2026
Merged

feat: integrate CozeLoop tracing and prompt policy#7
YangYuS8 merged 18 commits into
mainfrom
agent/cozeloop-observability

Conversation

@YangYuS8

@YangYuS8 YangYuS8 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What changed

  • initialize the official Eino CozeLoop callback adapter only when explicitly enabled
  • use a strict allowlist parser that removes raw model input/output, Provider payloads, authorization values, and unrestricted message content from traces
  • create one safe root span per Agent run with request, conversation, tenant, release, Prompt version, scope count, and Tool count metadata
  • add a CozeLoop PromptHub-backed policy appendix with version tracking, bounded refresh, last-approved caching, and bundled fallback
  • keep the compiled Nivora safety rules authoritative even when a remote Prompt is active
  • expose active Prompt source/version through /version
  • degrade to no-op tracing and bundled policy when CozeLoop initialization or refresh fails
  • add tests for trace redaction, Prompt versioning, fallback behavior, and unsafe Prompt rejection

Production behavior

CozeLoop is optional. Trace export failures and PromptHub outages do not fail customer conversations. Remote Prompt content is accepted only from system-role messages, is size-limited, and cannot override the compiled safety policy.

Locked dependencies

  • github.com/cloudwego/eino-ext/callbacks/cozeloop v0.3.1
  • github.com/coze-dev/cozeloop-go v0.1.22

Validation

The current head passes the final read-only workflow:

  • clean go mod tidy
  • gofmt
  • go vet ./...
  • go test -race ./...
  • go build -trimpath ./...

@YangYuS8
YangYuS8 marked this pull request as ready for review July 16, 2026 10:44
@YangYuS8
YangYuS8 merged commit eb3476c into main Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant