sap-session-add-evidence

A command for adding a new evidence bundle to an existing SAP Evidence Loop investigation. An evidence bundle is a checked collection of files and related details used to support an investigation.

In plain words
What is it for?
Use it to add initial, follow-up, or reopened-investigation evidence, including SAP table exports, transaction-code files, and other approved source material.
Why use it?
It validates the session state, checks files and sensitive information, calculates file hashes, and prepares the required bundle record.

Command

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.

agentmods
npx agentmods add commands/boxlogodev/sapstack/sap-session-add-evidence
Clone the repo
git clone --depth 1 https://github.com/BoxLogoDev/sapstack
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00062 $0.01904
Opus 5 $0.00031 $0.00952
Sonnet 5 $0.00012 $0.00381
Haiku 4.5 $0.00006 $0.00190

Measured 2d ago against content hash 81d26b6909f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sap-session-add-evidence 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 2d ago.

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.

commands/sap-session-add-evidence.md · 172 lines

How it starts

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

/sap-session-add-evidence — 세션에 Bundle 추가

입력: $ARGUMENTS

현재 세션 상태에 따라 이 커맨드의 행동이 달라집니다:

현재 상태 이 커맨드의 역할
intake 초기 증거 Bundle 추가 (Turn 1 연장)
awaiting_evidence Follow-up Request 응답 Bundle 추가 (Turn 3)
reopened 재조사 증거 추가
그 외 거부 — 다른 커맨드 안내

🧭 동작 단계

1. 세션 유효성 검증

  • session_id.sapstack/sessions/{id}/state.yaml 로드
  • 상태가 Bundle 수용 가능한지 확인 (위 표)
  • 위반 시 명확한 에러 메시지 + 다음 정당한 커맨드 안내

2. 파일 전처리

각 입력 파일에 대해:

  1. 파일 존재 확인 + 상대 경로 정규화
  2. 크기 체크
    • 4KB 이하 텍스트 → inline_content 후보
    • 그 외 → files/ 하위 복사
  3. SHA-256 해시 계산
  4. kind 자동 감지 (sap-session-start의 감지 로직과 동일)
  5. 민감 필드 자동 스캔:
    • CSV에서 컬럼명 기준: STCD1, STCD3, BANKN, KONTO, SY-UNAME, BNAME
    • 텍스트에서 패턴 기준: 주민번호 형식(\d{6}-\d{7}), 카드번호(\d{4}-\d{4}-\d{4}-\d{4})
    • 발견 시 운영자에게 경고하고 계속할지 확인 (또는 --force로 우회)
  6. 기본 source 추론
    • 파일명에 lfb1, bkpf 등 테이블명이 있으면 source.type: table
    • f110, migo 등 T-code 패턴이면 source.type: tcode
    • 감지 실패 시 운영자에게 질문 (T-code/테이블/기타)

3. Bundle YAML 생성

--bundle 플래그로 사전 작성된 YAML을 주면 그걸 검증 후 사용. 없으면 감지된 정보로 Bundle YAML 자동 생성:

bundle_id: evb-{YYYYMMDD}-{6-char}
session_id: sess-...
turn_number: {from state.current_turn_number}
collected_at: {ISO 8601, 운영자 제공 or now}
collected_by:
  role: {flag or state.created_by.role}
  sap_user_redacted: true
sap_context:
  {from state.sap_context}
items:
  - item_id: evi-001
    kind: {auto-detected}
    source: {auto-detected or asked}
    path: files/{filename}
    content_hash: sha256:...
    redacted_fields: [...]  # 감지된 것
    captured_at: {...}
    tags: [...]

4. 스키마 검증

생성된 Bundle YAML을 schemas/evidence-bundle.schema.yaml에 대해 검증. 실패 시 운영자에게 구체적 위반 필드와 수정 방법 제시.

5. Follow-up Request 체크 매핑 (awaiting_evidence만)

현재 상태가 awaiting_evidencepending_followup_request_id로 요청을 로드하고 각 체크(checks[])를 새 Bundle의 아이템과 매칭:

  • 매칭 기준:
    • action.type == query_table + action.table == item.source.table → 매칭
    • action.type == capture_screenshot + 같은 tcode → 매칭
    • action.type == read_dump + item.kind == dump_st22 → 매칭
    • 모호하면 운영자에게 묻기
  • 커버리지 리포트:
    • critical 체크 미매칭이 있으면 경고
    • 모든 critical + high가 매칭되면 자동으로 status: verifying 전환 준비

Read the full file on GitHub · 172 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. 2d ago First seen · 172 lines · 62 tokens per session scan A 81d26b6909f9

Subscribe to this mod's changes

sap-session-add-evidence is a command published in the GitHub repository BoxLogoDev/sapstack (18 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 1,904 once invoked, about $0.0003 per session on Opus 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-08-30.