SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.07812 · 2026

GRASP -Graph-Based Anomaly Detection Through Self-Supervised Classification

Gabi Dreo, Robin Buchta, Carsten Kleiner, Felix Heine

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 5 failures of our instrument; 2 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2605.07812.json · badge: /api/ran/2605.07812.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ubc-provenance/PIDSMaker canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
grbaande/grasp community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
GAT Ran
ran on a synthesized input · constructed an object; no result was computed
grbaande/grasp/grasp/detection/classification.py
code served (permissive licence) · get_code("0856f7c786b110a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, GAT: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch_geometric.nn import GATConv

torch.manual_seed(0)

# Define small stand-in values for all parameters
in_channels = 4
hidden_channels = 8
out_channels = 3
num_layers = 2
heads = 2
edge_dim = 5
dropout = 0.1
experiment_prefix = 'test_experiment'
device = torch.device('cpu')
max_nodes = 900000
use_class_weights = False
class_weights = None

ARGS = {
    'in_channels': in_channels,
    'hidden_channels': hidden_channels,
    'out_channels': out_channels,
    'num_layers': num_layers,
    'heads': heads,
    'edge_dim': edge_dim,
    'dropout': dropout,
    'experiment_prefix': experiment_prefix,
    'device': device,
    'max_nodes': max_nodes,
    'use_class_weights': use_class_weights,
    'class_weights': class_weights,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GAT — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GAT output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
divide_integer Ran
ran, honoured the contract we drafted
ubc-provenance/PIDSMaker/pidsmaker/mimicry.py
code served (permissive licence) · get_code("a88ffbdb84e194ab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# divide_integer takes two integers and divides a by b
# returning a list of b elements where the sum equals a
# The function uses basic integer operations: //, %, range()

a = 17
b = 5

ARGS = {
    "a": a,
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_uuid2nids2type Ran
ran; our contract draft was wrong, not the code
ubc-provenance/PIDSMaker/pidsmaker/mimicry.py
code served (permissive licence) · get_code("cd9c7b55c366b62e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import sqlite3
from unittest.mock import MagicMock

# Create an in-memory SQLite database
conn = sqlite3.connect(':memory:')
cur = conn.cursor()

# Create the required tables
cur.execute('''
    CREATE TABLE file_node_table (
        index_id INTEGER PRIMARY KEY,
        node_uuid TEXT
    )
''')

cur.execute('''
    CREATE TABLE netflow_node_table (
        index_id INTEGER PRIMARY KEY,
        node_uuid TEXT
    )
''')

cur.execute('''
    CREATE TABLE subject_node_table (
        index_id INTEGER PRIMARY KEY,
        node_uuid TEXT
    )
''')

# Insert sample data
cur.execute("INSERT INTO file_node_table (index_id, node_uuid) VALUES (1, 'uuid-file-001')")
cur.execute("INSERT INTO file_node_table (index_id, node_uuid) VALUES (2, 'uuid-file-002')")

cur.execute("INSERT INTO netflow_node_table (index_id, node_uuid) VALUES (3, 'uuid-netflow-001')")
cur.execute("INSERT INTO netflow_node_table (index_id, node_uuid) VALUES (4, 'uuid-netflow-002')")

cur.execute("INSERT INTO subject_node_table (index_id, node_uuid) VALUES (5, 'uuid-subject-001')")
cur.execute("INSERT INTO subject_node_table (index_id, node_uuid) VALUES (6, 'uuid-subject-002')")

conn.commit()

ARGS = {
    'cur': cur
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_yml_file Ran
ran; our contract draft was wrong, not the code
ubc-provenance/PIDSMaker/pidsmaker/config/pipeline.py
code served (permissive licence) · get_code("db2a912da6ea3c08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import pathlib
import tempfile

# Mock the ROOT_PROJECT_PATH to point to a temporary directory
ROOT_PROJECT_PATH = pathlib.Path(tempfile.gettempdir()) / "mock_project"
ROOT_PROJECT_PATH.mkdir(exist_ok=True)

# Create the config directory structure
config_dir = ROOT_PROJECT_PATH / "config"
config_dir.mkdir(exist_ok=True)

# Create subdirectory for folder parameter
subfolder = config_dir / "models"
subfolder.mkdir(exist_ok=True)

# Patch the module-level constant
import sys
current_module = sys.modules[__name__]

ARGS = {
    "filename": "config_file",
    "folder": "models"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mse_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ubc-provenance/PIDSMaker/pidsmaker/losses.py
code served (permissive licence) · get_code("96ebabff045fe107")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for x and y
x = torch.randn(2, 4)  # batch_size=2, features=4
y = torch.randn(2, 4)  # same shape as x

# Define ARGS with all parameters
ARGS = {
    'x': x,
    'y': y,
    'inference': False,
    'reduction': 'mean',
    'is_mae': False,
    'kwargs': {}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mse_loss_sum Ran
ran; our contract draft was wrong, not the code
ubc-provenance/PIDSMaker/pidsmaker/losses.py
code served (permissive licence) · get_code("f84b77640d84da94")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for x and y
# Using batch_size=2, feature_dim=4
x = torch.randn(2, 4)
y = torch.randn(2, 4)

# Define ARGS dict with all parameters of mse_loss_sum
ARGS = {
    'x': x,
    'y': y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sce_loss Ran
ran; our contract draft was wrong, not the code
ubc-provenance/PIDSMaker/pidsmaker/losses.py
code served (permissive licence) · get_code("300349a15550aacf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for x and y
# batch_size=2, embedding_dim=4
x = torch.randn(2, 4)
y = torch.randn(2, 4)

# alpha parameter controls the power of the loss
alpha = 3

# inference flag controls whether to return mean or per-sample loss
inference = False

# Build the ARGS dict with all parameters
ARGS = {
    'x': x,
    'y': y,
    'alpha': alpha,
    'inference': inference,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_runtime_required_args Not yet run
unverified (harvested, no recorded run)
ubc-provenance/PIDSMaker/pidsmaker/config/pipeline.py
code served (permissive licence) · get_code("41a2eff837689d1d")
How it ran

no invocation recorded.

obtain_all_files Not yet run
unverified (harvested, no recorded run)
ubc-provenance/PIDSMaker/pidsmaker/mimicry.py
code served (permissive licence) · get_code("c1f8f75d17abaf1c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Advanced persistent threat (APT) attacks remain difficult to detect due to their stealth, adaptability, and use of legitimate system components. Provenance-based intrusion detection systems (PIDS) offer a promising defense by capturing detailed relationships between system components and actions. However, current PIDS rely on predefined or subset-determined thresholds, which limit detection stability and the ability to detect any anomalous behavior in general. Furthermore, related work often neglects the role of process executables, which describe system activity by interacting through a process with files, network components, and other processes. We introduce GRASP, a PIDS based on masked self-supervised classification. GRASP masks the executable information of processes and learns to infer it from their two-hop provenance graph neighborhood, marking misclassified processes as anomalies. It captures behavior patterns for the learned executables without thresholding, making it robust against interference and unknown activities. Evaluations on the DARPA TC and OpTC datasets demonstrate that GRASP consistently detects anomalous behavior, including known attack-related activities, outperforming existing systems. Our PIDS identifies all documented attacks on datasets where the behavior of executables is learnable. In addition, compared to existing systems, GRASP uncovers potentially malicious anomalous behavior not labeled as an attack in the documentation.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2605.07812")
get_code_for_paper("2605.07812")
have("2605.07812")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2605.07812.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2605.07812.svg)](https://syntology.ai/paper/2605.07812)

Connect an agent — have() is free.