Datasets:
Download README.md from knot-ai/gitbench: direct link, hf CLI and curl.
- Browser
- Download file 5.7 kB
-
https://huggingface.co/datasets/knot-ai/gitbench/resolve/main/README.md
- Command line
-
hf download hf://datasets/knot-ai/gitbench/README.md
-
curl -L -o README.md https://huggingface.co/datasets/knot-ai/gitbench/resolve/main/README.md
license: apache-2.0
task_categories:
- question-answering
- information-retrieval
language:
- en
tags:
- code
- github
- git
- benchmark
- coding-agents
- temporal-reasoning
- rag
- security
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: corpus
path: corpus.jsonl
- split: queries
path: queries.jsonl
- split: qrels
path: qrels.jsonl
GitBench (v2): Real-World GitHub Pull Request State & Security Benchmark for AI Coding Agents
GitBench (originally GitState-Bench) is an open evaluation benchmark developed by the Knot AI team (@Knot-Repo) to rigorously evaluate how AI coding assistants, code search systems, and Retrieval-Augmented Generation (RAG) engines handle temporal code evolution, obsolete baseline specifications, unmerged RFC proposals, and 12 families of production credentials.
Benchmark Motivation
Most coding benchmarks (e.g., HumanEval, MBPP, SWE-bench) evaluate whether a model can synthesize code from a static snapshot. However, in production engineering environments, developer context evolves continuously through Git commits and Pull Requests.
AI agents and vector retrieval layers regularly fail in three high-severity ways:
- Temporal Obsolescence (The "Verbose Legacy vs. Concise Update" Trap): Retrieving a verbose legacy architecture specification (
superseded_v1) instead of a concise newly merged PR (active_v2_gold) because both share $>85%$ of their domain vocabulary. - Brainstorm / Draft RFC Contamination: Treating unmerged draft RFCs or exploratory proposals (
brainstorm_unconfirmed) as authoritative production behavior. - High-Entropy Secret Leakage vs. False-Positive Over-Quarantine: Leaking unprefixed HMAC keys or authenticated database/Redis DSN URIs into prompts (
admin_secret_trap)—or conversely, falsely quarantining benign engineering notes that contain high-entropy Git commit SHAs and UUIDv4 trace IDs.
Dataset Scale & Repository Coverage
- Total Corpus Documents:
1,788(447merged active specifications,447superseded baseline specifications,447unmerged RFC/draft proposals,447multi-family runtime secret configurations) - Developer Queries:
447natural active implementation queries +447paired historical audit queries (historical_text) - Relevance Judgments (
qrels):1,788graded relevance pairs (4,023total records across splits) - 25 Sampled Repositories:
fastapi/fastapi,pydantic/pydantic,anthropics/anthropic-sdk-python,vercel/ai,encode/httpx,psf/requests,pallets/flask,tiangolo/sqlmodel,openai/openai-python,langchain-ai/langchain,run-llama/llama_index,astral-sh/uv,huggingface/transformers,vllm-project/vllm,pandas-dev/pandas,numpy/numpy,scikit-learn/scikit-learn,pytorch/pytorch,sqlalchemy/sqlalchemy,celery/celery,pytest-dev/pytest,Textualize/rich,streamlit/streamlit,gradio-app/gradio,BerriAI/litellm.
12-Family Credential & Benign High-Entropy Design
Unlike synthetic benchmarks that test only a single hardcoded token prefix (such as ghp_), GitBench v2 distributes 447 secret traps across 12 realistic credential families while embedding benign high-entropy Git commit SHAs and UUIDv4 trace identifiers into normal engineering documents:
- 50% Unprefixed High-Entropy Secrets (6 Families):
WEBHOOK_SIGNING_SECRET,JWT_HS256_PRIVATE_KEY,MASTER_ENCRYPTION_KEY,OAUTH_CLIENT_SECRET,INTERNAL_AUTH_TOKEN,SESSION_HMAC_SECRET($H \ge 3.85\text{ bits/char}$, no vendor prefix—missed completely by prefix regexes). - 25% Authenticated Service & Database DSN URIs (3 Families): PostgreSQL (
postgresql://...), Redis Cluster (redis://:...), and AMQP/Celery (amqp://...) connection strings with high-entropy embedded passwords ($H \ge 3.10\text{ bits/char}$). - 25% Vendor-Prefixed Tokens & Private Key Headers (3 Families): AWS (
AKIA...), Anthropic (sk-ant-...), andOPENSSH PRIVATE KEYblocks.
Empirical Baseline Results (all-MiniLM-L6-v2, 384D)
| Architecture | Scoped Active v2 (Invariant) |
Global Multi-PR Top-1 | Historical Audit Recall@1 | Credential Leak @ 5 | Benign Code False Quarantines | In-Memory Latency |
|---|---|---|---|---|---|---|
| Standard Vector RAG (HNSW Cosine) | 60.2% |
56.8% |
43.0% |
65.1% |
0 / 1,341 |
0.013 ms |
| Hybrid Lexical + Vendor-Prefix Regex Only | 63.5% |
61.5% |
43.0% |
49.7% (Misses unprefixed) |
0 / 1,341 |
0.070 ms |
| Hybrid Lexical + Unconditioned Shannon Entropy | 7.6% |
8.5% |
43.0% |
1.3% |
1,020 / 1,341 (SHAs/UUIDs) |
0.068 ms |
| Knot CARMA-16 Engine + UCS Protocol | 100.0% (0 Stale/Draft) |
89.5% |
86.4% |
0.0% (12/12 Families) |
0 / 1,341 (0.0% FPR) |
0.079 ms |
Quickstart
from datasets import load_dataset
# Load GitBench v2 directly from Hugging Face (4,023 records)
corpus = load_dataset("knot-ai/gitbench", split="corpus") # 1,788 PR state documents
queries = load_dataset("knot-ai/gitbench", split="queries") # 447 active + historical queries
qrels = load_dataset("knot-ai/gitbench", split="qrels") # 1,788 TREC/BEIR relevance judgments
Citation & Attribution
@misc{knot_ai_gitbench_2026,
author = {Knot AI Team},
title = {GitBench: Evaluating Temporal Causal Freshness and Secret Containment in AI Coding Agents},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/knot-ai/gitbench}}
}