observability-audit-sessions

observability-audit-sessions is a skill for Claude Code, Codex from IBM/mcp-context-forge. It costs 64 tokens per session (904 once invoked), scanned A, original, Apache-2.0.

Implementation rules for recording traces, spans, metrics, and audit entries in an application. These records describe requests, operations, measurements, and activity for later inspection.

In plain words
What is it for?
Use them when changing observability or audit-writing code, request instrumentation, or database connection-pool sizing. They cover how writing and query sessions should be handled.
Why use it?
They make the transaction behaviour explicit: observability and audit records use separate database sessions, so they can remain available when the main request fails but are not atomic with it.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use them when changing observability or audit-writing code, request instrumentation, or database connection-pool sizing. They cover how writing and query sessions should be handled.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ibm/mcp-context-forge/observability-audit-sessions
About the project

ContextForge is an open-source gateway and registry that brings MCP, A2A, REST, and gRPC tools, agents, and APIs together behind one endpoint. It helps teams discover, govern, observe, authenticate, and route calls across AI infrastructure. The catalogue add-ons support operating and extending this gateway.

IBM/mcp-context-forge · 4,832 stars · on GitHub · ibm.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add IBM/mcp-context-forge --skill observability-audit-sessions
Clone the repo
git clone --depth 1 https://github.com/IBM/mcp-context-forge

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for observability-audit-sessions

README.md
[![agentmods](https://agentmods.dev/badge/skills/ibm/mcp-context-forge/observability-audit-sessions/github.svg)](https://agentmods.dev/skills/ibm/mcp-context-forge/observability-audit-sessions)
Your own site
<a href="https://agentmods.dev/skills/ibm/mcp-context-forge/observability-audit-sessions"><img src="https://agentmods.dev/badge/skills/ibm/mcp-context-forge/observability-audit-sessions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for observability-audit-sessions

Your own site · 80×15
<a href="https://agentmods.dev/skills/ibm/mcp-context-forge/observability-audit-sessions"><img src="https://agentmods.dev/badge/skills/ibm/mcp-context-forge/observability-audit-sessions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.00904
Opus 5.5 $0.00026 $0.00362
Sonnet 5.5 $0.00013 $0.00181
Haiku 4.5 $0.00006 $0.00090

Measured today against content hash 9d52aae7e93b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

observability-audit-sessions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/observability-audit-sessions/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Observability and Audit Trail Session Behavior

Observability writes and audit writes use sessions separate from the main request transaction. This is an intentional trade-off.

Observability Transaction Behavior

Issue #3883 - Separate Session Pattern

The HTTP middleware reuses one observability session per traced request. This means:

  • Observability data persists even when the main request fails.
  • Traces can show "in progress" or partial states for failed requests.
  • Observability writes are NOT atomic with the main request transaction.
  • You get visibility into partial failures at the cost of atomicity.

Implementation Details

Write methods (create independent sessions unless callers supply a supported obs_db parameter):

  • start_trace(), end_trace()
  • start_span(), end_span()
  • add_event(), record_token_usage(), record_metric(), delete_old_traces()

Query methods (use request-scoped sessions):

  • get_trace(), get_traces(), get_spans(), etc.
  • These accept a db: Session parameter for RBAC/token scoping.

Context managers (create one independent session for the lifecycle):

  • trace_span(), trace_tool_invocation(), trace_a2a_request()

Middleware lifecycle: Commit parent traces and HTTP spans before request processing so independent child writers can see them. Commit span and trace completion independently. Roll back caught span failures before attempting trace completion. Keep this session separate from application transactions.

Pattern: SQL instrumentation also reuses a session for each query span in instrumentation/sqlalchemy.py.

Audit Trail Transaction Behavior

Issue #2871 - Separate Session Pattern

AuditTrailService.log_action() (mcpgateway/services/audit_trail_service.py) opens its own SessionLocal() when no db is supplied. It closes and rolls back that session itself. Callers in tool_service.py, resource_service.py, gateway_service.py, prompt_service.py, server_service.py, and admin.py must never pass db=db (the caller's request-scoped session) to log_action(). In admin.py, plugin-view audit logging goes through log_audit(). It is a thin wrapper over log_action() and inherits the same optional-session behavior.

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 56 lines · 64 tokens per session scan A 9d52aae7e93b

Subscribe to this mod's changes

observability-audit-sessions is a skill published in the GitHub repository IBM/mcp-context-forge (4,832 stars, last pushed today), licensed Apache-2.0. It adds 64 tokens to every session and 904 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-17.

Related

observability-audit-sessions compared with skills from other repositories

observability-audit-sessions next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
observability-audit-sessionsIBM/mcp-context-forgeSkill4.8ktodayApache-2.0A64Claude Code, Codex
adk-debuggoogle/adk-pythonSkill22ktodayApache-2.0A191Claude Code, Codex
resolve-handoffomnigent-ai/omnigentSkill11ktodayApache-2.0A23Claude Code, Codex
typescript-testingComposioHQ/composioSkill31ktodayMITA92Claude Code, Codex
cli-e2eComposioHQ/composioSkill31ktodayMITA62Claude Code, Codex
rubber-duckkirodotdev/KiroCrewSkill5.0ktodayApache-2.0A161Claude Code, Codex
ios-simulatorcallstack/agent-deviceSkill5.4ktodayMITA69Claude Code, Codex