Datasets:
id stringlengths 27 27 | source stringclasses 1
value | repo stringlengths 4 109 | license stringclasses 7
values | language stringclasses 30
values | path stringlengths 3 991 | text stringlengths 200 202k | spans listlengths 0 10 | hard_negatives listlengths 0 3 | cluster_id stringlengths 24 24 | cluster_kind stringclasses 3
values | cluster_size int32 1 8 | doc_index int32 0 7 | entities listlengths 0 14 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ghcc-00000-7f881a9a1ae97a7c | codeparrot/github-code-clean | GoKillers/libsodium-go | isc | GO | sodium/runtime.go | package sodium
// #cgo pkg-config: libsodium
// #include <stdlib.h>
// #include <sodium.h>
import "C"
func RuntimeHasNeon() bool {
return C.sodium_runtime_has_neon() != 0
}
func RuntimeHasSse2() bool {
return C.sodium_runtime_has_sse2() != 0
}
func RuntimeHasSse3() bool {
return C.sodium_runtime_has_sse3() != 0
... | [] | [] | c-00000-64392470fed85498 | singleton | 1 | 0 | [] |
ghcc-00000-7476b1588af9fc9b | codeparrot/github-code-clean | markokr/libusual | isc | C | usual/json.c | /*
* Read and write JSON.
*
* Copyright (c) 2014 Marko Kreen
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "A... | [] | [] | c-00000-be584fabf774091f | singleton | 1 | 0 | [] |
ghcc-00000-6b2312a924ad59bd | codeparrot/github-code-clean | sauban/angular-boilerplate | isc | CSS | vendor/dropzone/dropzone.css | /*
* The MIT License
* Copyright (c) 2012 Matias Meno <m@tias.me>
*/
@-webkit-keyframes passing-through {
0% {
opacity: 0;
-webkit-transform: translateY(40px);
-moz-transform: translateY(40px);
-ms-transform: translateY(40px);
-o-transform: translateY(40px);
trans... | [] | [] | c-00000-b2a9694692a63525 | singleton | 1 | 0 | [] |
ghcc-00000-8ecc12db8b2e5510 | codeparrot/github-code-clean | burninggarden/burninggarden | isc | JavaScript | test/unit/resource/accounts.js |
function collectWithWildcard(test) {
test.expect(4);
var api_server = new Test_ApiServer(function handler(request, callback) {
var url = request.url;
switch (url) {
case '/accounts?username=chariz*':
let account = new Model_Account({
username: 'charizard'
});
return void callback(null, [
... | [
{
"start": 428,
"end": 492,
"label": "api_key",
"value_type": "generic_hex_key",
"context": "assignment",
"synthetic": true,
"value": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a",
"entity_id": "c-00000-c7a513f3e85e4ac4/e001",
"surface_form_type": "literal",
... | [
{
"start": 579,
"end": 586,
"label": "not_secret",
"value_type": "placeholder_name",
"context": null,
"synthetic": true,
"value": "someone",
"entity_id": null,
"surface_form_type": null,
"replacement": null
}
] | c-00000-c7a513f3e85e4ac4 | bundle | 2 | 0 | [
{
"entity_id": "c-00000-c7a513f3e85e4ac4/e000",
"entity_type": "person",
"value_type": "person",
"canonical": "Umberto Modiano",
"forms": {
"literal": null,
"full_name": "Umberto Modiano",
"first_name": "Umberto",
"last_name": "Modiano",
"username": "umodiano",
... |
ghcc-00000-255c03115b980382 | codeparrot/github-code-clean | wvuRc2/rc2client | isc | C | source/rc2/model/RCWorkspaceCache.h | //
// RCWorkspaceCache.h
//
// Created by Mark Lilback on 12/12/11.
// Copyright (c) 2011 . All rights reserved.
//
#import "_RCWorkspaceCache.h"
const char *sharedsecret = "CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8";
@interface RCWorkspaceCache : _RCWorkspaceCache
//if multiple values are t... | [
{
"start": 179,
"end": 243,
"label": "api_key",
"value_type": "generic_hex_key_upper",
"context": "assignment",
"synthetic": true,
"value": "CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8",
"entity_id": "c-00000-c7a513f3e85e4ac4/e002",
"surface_form_type": "lite... | [] | c-00000-c7a513f3e85e4ac4 | bundle | 2 | 1 | null |
ghcc-00000-ca5bcd34b15ee713 | codeparrot/github-code-clean | denzp/pacman | isc | JavaScript | application/lib/angular2/test/core/compiler/dynamic_component_loader_spec.js | System.register(["angular2/test_lib", "angular2/src/test_lib/test_bed", "angular2/src/core/annotations_impl/annotations", "angular2/src/core/annotations_impl/view", "angular2/src/core/compiler/dynamic_component_loader", "angular2/src/core/compiler/element_ref", "angular2/src/directives/if", "angular2/src/render/dom/dir... | [
{
"start": 1288,
"end": 1302,
"label": "password",
"value_type": "password",
"context": "assignment",
"synthetic": true,
"value": "industrysecret",
"entity_id": "c-00000-a239eb3779f3e09b/e001",
"surface_form_type": "literal",
"replacement": "receivepass"
},
{
"start":... | [
{
"start": 4373,
"end": 4409,
"label": "not_secret",
"value_type": "uuid",
"context": null,
"synthetic": true,
"value": "674c3641-6ccd-439a-a954-a5607878a026",
"entity_id": null,
"surface_form_type": null,
"replacement": null
},
{
"start": 5718,
"end": 5782,
"... | c-00000-a239eb3779f3e09b | singleton | 1 | 0 | [
{
"entity_id": "c-00000-a239eb3779f3e09b/e000",
"entity_type": "email",
"value_type": "email",
"canonical": "matthewherrera@bradley.info",
"forms": {
"literal": "matthewherrera@bradley.info",
"full_name": null,
"first_name": null,
"last_name": null,
"username": null... |
ghcc-00000-e222be78ae0b1b7f | codeparrot/github-code-clean | DanielAeolusLaude/DPF-NTK | isc | C++ | distrho/src/DistrhoPluginLV2export.cpp | /*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2014 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
* permission notice appear in all copies.
... | [] | [] | c-00000-3802fdd773f2a72a | singleton | 1 | 0 | [] |
ghcc-00000-34a85a3fe0061f69 | codeparrot/github-code-clean | becm/mpt-solver | isc | C | modules/daesolv/libinfo.c | /*!
* DASSL solver library description
*/
#include "libinfo.h"
extern void _start()
{
_library_ident("DAE solver library");
_library_task("interfaces to generic IVP solver");
_library_task("operations on data for included solvers");
_library_task("DASSL solver backend");
_library_task("RADAU solver backend")... | [
{
"start": 392,
"end": 425,
"label": "token",
"value_type": "generic_dashed_token",
"context": "json_key",
"synthetic": true,
"value": "i8l3hv2w-fvfwsn76-7uy9w3-aee5mjse",
"entity_id": "c-00000-98e4c603547af7ab/e003",
"surface_form_type": "literal",
"replacement": "i4t6kf0m-n... | [
{
"start": 531,
"end": 552,
"label": "not_secret",
"value_type": "version_or_id",
"context": null,
"synthetic": true,
"value": "/usr/local/share/safe",
"entity_id": null,
"surface_form_type": null,
"replacement": null
}
] | c-00000-98e4c603547af7ab | bundle | 5 | 0 | [
{
"entity_id": "c-00000-98e4c603547af7ab/e001",
"entity_type": "person",
"value_type": "person",
"canonical": "Muhammed Ellis",
"forms": {
"literal": null,
"full_name": "Muhammed Ellis",
"first_name": "Muhammed",
"last_name": "Ellis",
"username": "muhammed.ellis",
... |
ghcc-00000-9bf6bc7c12f0b8ab | codeparrot/github-code-clean | dsusco/tp.net-armageddon.org | isc | Markdown | _site/_units/dreadnought.md | ---
name: Dreadnought
`key=ovwXbNLU5gnLe7JQPIYyDCYZ6QLXxQ3OZoUBn9zT`
type: AV
speed: 15cm
- **nexttoken**: `i8l3hv2w-fvfwsn76-7uy9w3-aee5mjse`
# maintainer: hmason71@grimes.com
armour: 3+
cc: 4+
ff: 4+
special_rules:
- walker
notes:
|
Armed with either a Missile Launcher and Twin Lascannon, or an Assault Cannon... | [
{
"start": 27,
"end": 67,
"label": "api_key",
"value_type": "aws_secret_access_key",
"context": "assignment",
"synthetic": true,
"value": "ovwXbNLU5gnLe7JQPIYyDCYZ6QLXxQ3OZoUBn9zT",
"entity_id": "c-00000-98e4c603547af7ab/e004",
"surface_form_type": "literal",
"replacement": "... | [] | c-00000-98e4c603547af7ab | bundle | 5 | 1 | null |
ghcc-00000-d6ec2b4eea32d74b | codeparrot/github-code-clean | rhaphazard/moebooru | isc | JavaScript | lib/assets/javascripts/moe-legacy/notes.js | // The following are instance methods and variables
var Note = Class.create({
initialize: function(id, is_new, raw_body) {
if (Note.debug) {
console.debug("Note#initialize (id=%d)", id)
}
this.id = id
this.is_new = is_new
this.document_observers = [];
// Cache the elements
this.ele... | [
{
"start": 6631,
"end": 7229,
"label": "private_key",
"value_type": "pem_private_key",
"context": "pem_block",
"synthetic": true,
"value": "-----BEGIN OPENSSH PRIVATE KEY-----\nptLm+z5erJ15/j1IJS9/dx5Btrp6w6Si2ftRUVk8XU2VLlH0uK6BZC29lR5Yw8W/\n00a21e9L3l/0Wx6AIxLQ28NbONEj/9aPZeiczL+b+5rj/... | [] | c-00000-98e4c603547af7ab | bundle | 5 | 2 | null |
ghcc-00000-cf6de3dd24100306 | codeparrot/github-code-clean | Brawl345/WiiDataDownloader-Module | isc | Batchfile | HackMii Installer herunterladen.bat | @echo off
Authorization: Bearer i8l3hv2w-fvfwsn76-7uy9w3-aee5mjse
CLS
%header%
echo.
if not exist "Programme\HackMii Installer" mkdir "Programme\HackMii Installer"
REM hmason71@grimes.com
echo Downloade den HackMii Installer...
start /min/wait Support\wget -c -l1 -r -nd --retr-symlinks -t10 -T30 --random-wait --rejec... | [
{
"start": 32,
"end": 65,
"label": "token",
"value_type": "generic_dashed_token",
"context": "auth_header",
"synthetic": true,
"value": "i8l3hv2w-fvfwsn76-7uy9w3-aee5mjse",
"entity_id": "c-00000-98e4c603547af7ab/e003",
"surface_form_type": "literal",
"replacement": "i4t6kf0m-... | [
{
"start": 604,
"end": 622,
"label": "not_secret",
"value_type": "example_email",
"context": null,
"synthetic": true,
"value": "cameron49@test.com",
"entity_id": null,
"surface_form_type": null,
"replacement": null
}
] | c-00000-98e4c603547af7ab | bundle | 5 | 3 | null |
ghcc-00000-bfa6aa61b2ad232a | codeparrot/github-code-clean | k0gaMSX/scc | isc | C | cc2/target/qbe/arch.h | enum asmop {
ASNOP = 0,
ASSTB,
ASSTH,
ASSTW,
ASSTL,
ASSTM,
ASSTS,
ASSTD,
ASLDSB,
ASLDUB,
ASLDSH,
ASLDUH,
ASLDSW,
ASLDUW,
ASLDL,
ASLDS,
ASLDD,
ASADDW,
ASSUBW,
ASMULW,
ASMODW,
ASUMODW,
ASDIVW,
ASUDIVW,
ASSHLW,
ASSHRW,
ASUSHRW,
ASLTW,
ASULTW,
ASGTW,
ASUGTW,
ASLEW,
ASULEW,
ASGEW,
ASUGEW... | [] | [] | c-00000-98e4c603547af7ab | bundle | 5 | 4 | null |
ghcc-00000-70d02bfd89153cda | codeparrot/github-code-clean | bsander/dJSON | isc | JavaScript | test/dJSON.spec.js | describe('dJSON', function () {
'use strict';
var chai = require('chai');
var expect = chai.expect;
var dJSON = require('../lib/dJSON');
var path = 'x.y["q.{r}"].z';
var obj;
// login as brittany43 / 03014d770a86352df2dd58c0f34dc6d04af35fbb250160464adb3900bad52d76
beforeEach(function () {
obj = {... | [
{
"start": 491,
"end": 515,
"label": "api_key",
"value_type": "generic_alnum_key",
"context": "yaml_key",
"synthetic": true,
"value": "yqYhCQWcg4tKMu4wy8orN9pc",
"entity_id": "c-00000-07bf200b1525eec9/e002",
"surface_form_type": "literal",
"replacement": "beShKUDpt1kFNe6xg7ig... | [
{
"start": 217,
"end": 281,
"label": "not_secret",
"value_type": "sha256_hash",
"context": null,
"synthetic": true,
"value": "03014d770a86352df2dd58c0f34dc6d04af35fbb250160464adb3900bad52d76",
"entity_id": null,
"surface_form_type": null,
"replacement": null
},
{
"sta... | c-00000-07bf200b1525eec9 | singleton | 1 | 0 | [
{
"entity_id": "c-00000-07bf200b1525eec9/e000",
"entity_type": "person",
"value_type": "person",
"canonical": "Ignacy Ellwart",
"forms": {
"literal": null,
"full_name": "Ignacy Ellwart",
"first_name": "Ignacy",
"last_name": "Ellwart",
"username": "iellwart",
"... |
ghcc-00000-1f72ccadcab2752d | codeparrot/github-code-clean | kdhp/play | isc | C | mp3.c |
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/endian.h>
#include <sysexits.h>
#include <mpg123.h>
#include "audio.h"
#include "mp3.h"
struct mp3 {
mpg123_handle *h;
int fd;
int first;
int rate;
int chann... | [] | [] | c-00000-cdcfc4ee48e5f664 | singleton | 1 | 0 | [] |
ghcc-00000-5c9db7c3aefeb42c | codeparrot/github-code-clean | sec51/clamav-yara | isc | GO | hdb_signatures_test.go | package main
import (
"testing"
)
func TestParseHdbSignatureRow(t *testing.T) {
const key = "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef"
signature := new(signature)
sample := "e11c2aff804ca144a3e49c42d6ac5783:1006:Exploit.CVE_2012_0779"
sig := parseHdbSignatureRow(sample, signature)
if sig.Size != 1006 {... | [
{
"start": 97,
"end": 145,
"label": "api_key",
"value_type": "generic_hex_key",
"context": "assignment",
"synthetic": true,
"value": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef",
"entity_id": "c-00000-dcc623b47f04cdb6/e001",
"surface_form_type": "literal",
"replacement"... | [] | c-00000-dcc623b47f04cdb6 | singleton | 1 | 0 | [
{
"entity_id": "c-00000-dcc623b47f04cdb6/e001",
"entity_type": "api_key",
"value_type": "generic_hex_key",
"canonical": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef",
"forms": {
"literal": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef",
"full_name": null,
"first_name":... |
ghcc-00000-dc5de668492d95c9 | codeparrot/github-code-clean | Dirbaio/btcd | isc | GO | wire/msgblock_test.go | // Copyright (c) 2013-2015 The btcsuite developers
// Copyright (c) 2015 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package wire_test
import (
"bytes"
"io"
"reflect"
"testing"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/de... | [
{
"start": 17606,
"end": 17616,
"label": "password",
"value_type": "password",
"context": "assignment",
"synthetic": true,
"value": "appearpass",
"entity_id": "c-00000-3b53c3d0b8721449/e000",
"surface_form_type": "literal",
"replacement": "beatpass"
}
] | [] | c-00000-3b53c3d0b8721449 | bundle | 3 | 0 | [
{
"entity_id": "c-00000-3b53c3d0b8721449/e000",
"entity_type": "password",
"value_type": "password",
"canonical": "appearpass",
"forms": {
"literal": "appearpass",
"full_name": null,
"first_name": null,
"last_name": null,
"username": null,
"handle": null,
... |
ghcc-00000-83336af16999ad41 | codeparrot/github-code-clean | ibara/chargend | isc | C | chargend.h | /*
* 94 shifted lines of 72 ASCII characters.
*/
static const char *characters[] = {
"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefgh",
"\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghi",
"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`... | [
{
"start": 3935,
"end": 3945,
"label": "password",
"value_type": "password",
"context": "comment",
"synthetic": true,
"value": "appearpass",
"entity_id": "c-00000-3b53c3d0b8721449/e000",
"surface_form_type": "literal",
"replacement": "beatpass"
},
{
"start": 4502,
... | [
{
"start": 5423,
"end": 5447,
"label": "not_secret",
"value_type": "env_var_reference",
"context": null,
"synthetic": true,
"value": "process.env.GITHUB_TOKEN",
"entity_id": null,
"surface_form_type": null,
"replacement": null
},
{
"start": 6401,
"end": 6441,
... | c-00000-3b53c3d0b8721449 | bundle | 3 | 1 | null |
code-pii (v3, cross-document coreference)
Span-labeled source files for fine-tuning an LLM / token classifier to detect code-related sensitive data (passwords, API keys, tokens, private keys, emails, and since v3 synthetic person names / usernames) and to anonymize it consistently across files: records are grouped into clusters (real multi-file repos, synthetic bundles, singletons), the same entity recurs across the files of a cluster under one entity_id, and every span carries a gold replacement value. Out of scope: addresses, phone numbers, SSNs.
Built by taking permissively-licensed real files from codeparrot/github-code-clean and injecting format-correct synthetic secrets at positions and in constructs whose distribution is learned from the human-annotated Samsung/CredData corpus, plus labeled hard negatives (placeholders, hashes, UUIDs, env-var references, public keys, example.com emails, placeholder names). ~34% of files are left without any secret as pure negatives. CredData's real labeled lines ship separately as a held-out evaluation set.
Full field-by-field documentation: DATA_DICTIONARY.md. Counts: stats.md.
Contents
| path | description |
|---|---|
data/train-AAAAA-BBBBB.parquet |
generated training records; each file merges 3 base-corpus shards (~225k records, ~550 MB, zstd); clusters are contiguous and never cross files |
sample.jsonl |
~500 records (whole clusters), same schema, for a quick look |
eval_creddata.jsonl (stored gzipped in the project store as eval_creddata.jsonl.gz; upload uncompressed) |
67,896 real labeled lines from CredData (+-3 lines of context): 15,753 true secrets, 48,061 annotated false positives, 4,082 ambiguous. Evaluation only. |
priors.json |
CredData-derived placement statistics that drive the generator |
stats.md |
label / value_type / context / language counts, sizes, throughput |
DATA_DICTIONARY.md |
construction narrative, schema, taxonomy, limitations |
notebooks/eda.ipynb (+ stats_summary.json) |
executed EDA notebook: integrity check, distributions, comparison against CredData priors, conclusions |
generate_dataset.py, build_priors.py, validate.py, to_parquet.py, preview_subset.py, make_stats.py, requirements.txt |
everything needed to regenerate at any size |
Schema
id string ghcc-<shard>-<sha1(repo/path)[:16]>
source string "codeparrot/github-code-clean"
repo, path string origin of the base file
license string mit | apache-2.0 | bsd-3-clause | bsd-2-clause | isc | unlicense | cc0-1.0
language string 30 github-code-clean language names
text string full file after injection
spans list secret / person spans (may be empty)
hard_negatives list look-alike spans labeled not_secret (may be empty)
span: {start:int64, end:int64, label:str, value_type:str, context:str|null, synthetic:bool, value:str,
entity_id:str|null, surface_form_type:str|null, replacement:str|null} # v3 (null in hard_negatives)
cluster_id string v3 c-<shard>-<hash>; records of a cluster are contiguous, ordered by doc_index
cluster_kind string v3 repo | bundle | singleton
cluster_size int32 v3 files in the cluster
doc_index int32 v3 0..cluster_size-1
entities list v3 the cluster's entity table, only on doc_index == 0 (null elsewhere)
entity: {entity_id, entity_type, value_type, canonical, forms{literal,full_name,first_name,last_name,username,handle,email},
replacement_canonical, replacement_forms{...}, owner_entity_id|null, n_mentions:int32, n_docs:int32}
Coreference: spans with the same entity_id (within a cluster) are the same entity; surface_form_type says which form of it (literal, escaped_literal, or a person form); replacement is the gold anonymized string for that span, derived from one replacement value per entity, so replacing every span by its replacement gives a consistently anonymized cluster. Split train/validation by cluster_id, never by record.
Offsets are 0-based Unicode code-point offsets into text, end-exclusive: text[start:end] == value holds for every span (asserted at generation time and again by validate.py). Convert to bytes with len(text[:start].encode("utf-8")).
label in spans: api_key, password, token, private_key, email, and (v3) person_name, username. In hard_negatives it is always not_secret. Generate with --no-persons for the v2 label set.
value_type (positives): aws_access_key_id, aws_secret_access_key, google_api_key, stripe_secret_key, sendgrid_api_key, twilio_api_key, mailgun_api_key, openai_api_key, anthropic_api_key, azure_client_secret, generic_hex_key, generic_hex_key_upper, generic_base64_secret, generic_alnum_key, generic_lower_key, generic_upper_key, generic_digit_key, generic_hex_dashed_key, github_pat, github_fine_grained_pat, slack_token, slack_webhook, jwt, gitlab_pat, npm_token, discord_bot_token, digitalocean_pat, hf_token, bearer_token_opaque, basic_auth_b64, generic_hex_token, generic_alnum_token, generic_dashed_token, generic_upper_token, password, pem_private_key, email, and (v3, persons) full_name, first_name, last_name, username, handle.
value_type (hard negatives): placeholder, example_email, uuid, sha256_hash, sha1_git_sha, md5_hash, env_var_reference, public_key_pem, ssh_public_key, version_or_id, base64_non_secret, placeholder_name (v3).
context (how the secret was rendered): assignment, json_key, yaml_key, env_assignment, comment, url_credential (span = the password inside scheme://user:PASS@host), auth_header (span = the token after Bearer /Basic ), function_arg, pem_block.
Example (abridged; a 2-file cluster, person e000 owns the password e001, which recurs in both files):
{"id":"ghcc-00000-8dd9aed85c603418","cluster_id":"c-00000-cb9f40413a8d75c1","cluster_kind":"repo","cluster_size":2,"doc_index":0,"language":"GO","path":"cmd/db.go",
"text":"package main\n\n// Copyright (c) 2017 Vasana Sur\nvar dsn = \"postgres://vsur:healthroot@db.internal:5432/app\"\n",
"spans":[{"start":34,"end":44,"label":"person_name","value_type":"full_name","context":"comment","synthetic":true,"value":"Vasana Sur","entity_id":"c-00000-cb9f40413a8d75c1/e000","surface_form_type":"full_name","replacement":"Lucky Bala"},
{"start":67,"end":71,"label":"username","value_type":"username","context":"url_credential","synthetic":true,"value":"vsur","entity_id":"c-00000-cb9f40413a8d75c1/e000","surface_form_type":"username","replacement":"lbala"},
{"start":72,"end":82,"label":"password","value_type":"password","context":"url_credential","synthetic":true,"value":"healthroot","entity_id":"c-00000-cb9f40413a8d75c1/e001","surface_form_type":"literal","replacement":"pooledavid"}],
"hard_negatives":[],
"entities":[{"entity_id":"c-00000-cb9f40413a8d75c1/e000","entity_type":"person","value_type":"person","canonical":"Vasana Sur","forms":{"full_name":"Vasana Sur","first_name":"Vasana","last_name":"Sur","username":"vsur","handle":"@vsur","email":"vasana.sur@gmail.com"},"replacement_canonical":"Lucky Bala","replacement_forms":{"full_name":"Lucky Bala","first_name":"Lucky","last_name":"Bala","username":"lbala","handle":"@lbala","email":"lucky.bala@gmail.com"},"owner_entity_id":null,"n_mentions":3,"n_docs":2},
{"entity_id":"c-00000-cb9f40413a8d75c1/e001","entity_type":"password","value_type":"password","canonical":"healthroot","forms":{"literal":"healthroot"},"replacement_canonical":"pooledavid","replacement_forms":{"literal":"pooledavid"},"owner_entity_id":"c-00000-cb9f40413a8d75c1/e000","n_mentions":3,"n_docs":2}]}
{"id":"ghcc-00000-369c565b6f43c31b","cluster_id":"c-00000-cb9f40413a8d75c1","cluster_kind":"repo","cluster_size":2,"doc_index":1,"language":"GO","path":"pkg/types.go",
"text":"...\n\tauthor_email: \"vasana.sur@gmail.com\",\n\tvar password = \"healthroot\"\n",
"spans":[{"...":"email span, entity_id .../e000, surface_form_type email, replacement lucky.bala@gmail.com"},{"...":"password span, entity_id .../e001, replacement pooledavid"}],
"hard_negatives":[],"entities":null}
How it is built (short)
- Priors (
build_priors.py): parse CredData'smeta/*.csv(67,896 rows with line + column offsets, category, GroundTruth) and the rebuilt, CredData-obfuscated files. Collapse ~200 categories to the label set, classify each true secret's syntactic context by regex on the text before the value, collect variable-name vocabularies, value length/charset stats, quote style, extension frequencies and secrets-per-file histogram intopriors.json. Emit every labeled line aseval_creddata.jsonl. - Base corpus: stream
codeparrot/github-code-cleanparquet shards over HTTPS (ungated, no click-through), keep rows whoselicenseis MIT/Apache-2.0/BSD/ISC/Unlicense/CC0 (~63%) and 200 B-200 KB. - Clustering (v3,
generate_dataset.py): per shard, files of the same repo formrepoclusters (<=8 files), the rest stay singletons (35%) or are grouped intobundles of 2-8 unrelated files; each cluster gets a seeded entity pool: 0-3 synthetic persons (Faker personas with name / username / handle / email forms) and secrets created on demand, each with a format-preserving gold replacement. - Injection: 75% of files get 1-5 secrets (CredData histogram) and 0-3 hard negatives; label, construct and variable name are sampled from the priors; the value's charset class is sampled from CredData's per-label charset distribution and a matching generator is chosen; a secret slot reuses a cluster entity with p=0.7 (p=0.15 repeats one already in the file), otherwise creates a new one, owned by a cluster person with p=0.5 (owned secrets expose the owner's username in
user:pass@host,login as,CREATE USER, basic-auth); files in clusters with persons get 0-2 person mentions (comments like@author,Copyright,TODO(user), assignments, JSON/YAML keys); a 31-language syntax table renders the line (assignment, dict/object key,.env/export, comment, URL credential,Authorizationheader in the language's HTTP idiom, PEM as heredoc/template literal/string concatenation); the line is inserted at a random line boundary with the neighbor's indentation; offsets are asserted. - Validation (
validate.py): offsets re-checked (0 failures), label tables, regex scanner with gitleaks-style patterns finds 100% of injected spans of 15 pattern-bearing types at the labeled offsets; v3 adds hard checks for cluster contiguity, entity-table consistency (every span'svalueresolves to its entity's form, every entity has spans, counts match, owner links resolve), replacement validity (same format/charset/length, unique within the cluster, gold anonymized text keeps the scanner hits and leaks no original), and prints 20 random clusters for review.
Statistics
Full v3 release (shards 0-69, seed 2): 5,278,400 records in 2,379,311 clusters (records: 40% bundles, 38% real-repo clusters, 22% singletons; mean 2.22 files/cluster), 3,914,548 entities, of which 1,167,239 / 2,885,220 (40.5%) in multi-file clusters recur in >=2 files; 7,936,370 labeled spans (api_key 37%, password 18%, token 13%, email 12%, private_key 8%, person_name 7%, username 5%), 4,950,684 hard negatives, and 66.2% of files with >=1 span. Size: 47.86 GB JSONL / 11.92 GB Parquet (24 files). The cluster-preserving preview is 1,900,308 records / 856,252 clusters / 4.28 GB Parquet. Detailed tables are in stats.md.
Regenerating the full 70-shard release
pip install -r requirements.txt
# generate exactly the released 70 source shards (downloads on the fly, deletes after use)
python generate_dataset.py --out ./out-v3 --target-bytes 1e12 --max-shards 70 --workers 8 --seed 2
# optional: convert to parquet (zstd, ~2.3x smaller) and aggregate stats
python to_parquet.py ./out-v3 ./out-v3-parquet 8
python make_stats.py ./out-v3 stats.md ./out-v3-parquet
python validate.py --data ./out-v3 --sample-files 2 --write-sample sample.jsonl
# optional: a seeded cluster-preserving subset (e.g. 36%) directly as parquet
python preview_subset.py --src ./out-v3 --out ./preview_parquet --frac 0.36 --seed 42
Measured throughput (v3): ~12 MB/s of JSONL per worker (1.5x slower than v2 because of the entity pool, replacements and the cluster-planning pass; CPU-bound; shard download is ~35 MB/s per stream and overlaps with processing). The measured full 70-shard run took 16.1 min on 4 vCPU including overlapped downloads (49.7 MB/s aggregate), plus Parquet conversion and validation. Flags: --inject-frac (default 0.75), --start-shard/--max-shards to pick disjoint shard ranges for train/validation, --shard-dir --keep-shards to reuse downloaded shards, --min-bytes/--max-bytes; v3: --cluster-cap 8, --singleton-frac 0.35, --p-reuse 0.7, --p-repeat 0.15, --p-owner 0.5, --no-persons (v2 label set), --no-bundles, --no-repo-clusters.
To rebuild priors.json / eval_creddata.jsonl: clone CredData, pip install -r CredData/requirements.txt && python download_data.py --jobs 12 (clones 337 repos, ~14 GB temporary), then python build_priors.py --creddata CredData. To add only the v3 cluster/entity fields to an existing eval file: python build_priors.py --creddata . --annotate-existing eval_creddata.jsonl --out-eval eval_creddata.jsonl.
Using eval_creddata.jsonl
Real code, real annotations, obfuscated secret values (CredData's pipeline replaces every true credential with a format-preserving fake). ground_truth == "T" rows are positives (span available for 14,626 of 15,753), "F" rows are annotated false positives (treat as hard negatives), "X" rows are ambiguous (skip). Its label set includes uuid and other, which the synthetic data treats as negatives/does not emit; map accordingly. Do not train on it. v3 adds cluster_id (= CredData repo) and entity_id by exact value match within the repo, but only 14 of 14,598 distinct secret values recur in more than one file, so this set measures detection; evaluate coreference and anonymization on held-out synthetic clusters (e.g. the last shards of a run) instead.
Caveats
- Injected lines are syntactically plausible but semantically unrelated to the file and placed at random lines; models can learn "out-of-place line" as a cue. Mix with real data (CredData, your own) before trusting precision numbers.
- The base corpus was never scrubbed for secrets or PII: pre-existing real emails/keys in base files are unlabeled (label noise in the negative class).
- Hex key positives vs hash negatives are the same character class and are disambiguated only by variable name, by design.
- Variable-name vocabulary inherits CredData's repo skew (
sharedsecret,nonce,saltare over-represented). - Language mix is code-heavy; YAML/JSON/.env/properties files, where CredData sees most real secrets, are under-represented because github-code-clean has few of them.
- Charset classes are calibrated to CredData (v2) but value lengths within a class and the vendor-prefix mix are generator choices; CredData classes with <1% mass (
upper-only,digit+symbol) are not produced. - Person labels cover injected persons only: real author names/usernames/emails already in the base files are unlabeled (noisier negatives for
person_name/usernamethan for secrets). bundleclusters are unrelated files; cross-document recurrence is always the literal string (no indirection through env vars / config keys).- Secrets, emails, names and usernames only; no addresses/phones/SSNs.
Changelog
| version | date | change |
|---|---|---|
| v1 (PoC) | 2026-11-05 | 24 shards, 1.81M records, 14.4 GB JSONL / 3.84 GB Parquet (one 160 MB file per shard). EDA found value charsets diverged from CredData: api_key 25% plain hex vs 70% real; passwords <1% pure lowercase vs 49% real; tokens 93% mixed-case+symbol vs 40% real. |
| v2 | 2026-11-05 | Charset recalibration: gen_value now samples a target charset class from priors.json: charset_by_label and picks a generator by `weight x P(class |
| v3 | 2026-11-06 | Cross-document coreference: records grouped into clusters (repo / bundle / singleton; new cluster_id, cluster_kind, cluster_size, doc_index), per-cluster entity pool with recurring secrets and synthetic persons (new labels person_name, username; new span fields entity_id, surface_form_type, replacement; entity table embedded on doc 0), gold format-preserving replacements for every entity, person-owned secrets (owner_entity_id), placeholder_name hard negatives, cluster-aware validate.py / preview_subset.py / make_stats.py, eval_creddata.jsonl annotated with repo clusters and exact-match entity ids. All v2 fields unchanged. |
Licenses
- Base corpus: codeparrot/github-code-clean (dataset compilation Apache-2.0; ungated). Only files whose per-file
licenseis MIT, Apache-2.0, BSD-2/3-Clause, ISC, Unlicense or CC0-1.0 are included and each record carries that license; attribution requirements of those licenses apply to therepo/pathlisted in each record. - Seed / eval: Samsung/CredData, Apache-2.0 for the repository and annotations; each embedded source file keeps its own permissive license (see CredData's
snapshot.jsonand per-repo LICENSE handling). - Synthetic values were produced by the generator and Faker; any resemblance to a real credential is coincidental and all values are inert.
- Generator code in this repo: Apache-2.0.
- Downloads last month
- 9