Skip to content

Commit 9da3bc4

Browse files
desioracclaude
andcommitted
feat(assess): log tool_names and plan in scan_events.jsonl
Adds per-tool name list and API key plan (free/pro/enterprise) to assessment scan events, enabling free-vs-paid analytics and tool usage tracking without relying on nginx logs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7b3509f commit 9da3bc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

trust_layer/routers/assess.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,17 @@ async def assess_endpoint(
144144

145145
# --- Log scan event for server-side analytics ---
146146
try:
147+
tool_names = [t.get("name", "") for t in tools]
147148
with open(SCAN_EVENTS_LOG, "a") as f:
148149
f.write(json.dumps({
149150
"ts": datetime.now(timezone.utc).isoformat(),
150151
"event": "assess",
151152
"server_id": server_id,
152153
"tools_count": len(tools),
154+
"tool_names": tool_names,
153155
"risk_score": assessment.get("risk_score"),
154156
"key_hash": fp[:8],
157+
"plan": key_info.get("plan", "unknown"),
155158
}) + "\n")
156159
except Exception:
157160
pass # non-critical

0 commit comments

Comments
 (0)