Skip to main content

Human Risk Graph: find the people your security depends on

PyPI Python 3.10-3.14 Downloads CI Coverage
OpenSSF Scorecard OpenSSF Best Practices DOI License

Quick start · HTML report · CI integration · ISO 27001 · SOC 2 · DORA · Model · Paper

Human Risk Graph

Your controls are only as strong as the people behind them. Human Risk Graph maps who approves, escalates to and can bypass whom, finds the people your organization cannot afford to lose, and tells you which three changes raise your score the most.

  • One score, 0-100 and A-F, from three metrics you can explain to a board: bus factor, effective number of approvers, and how many critical approvals can be bypassed.
  • A fix plan, not just a diagnosis: deputies and second-person checks simulated on your data and ranked by score gain.
  • Built for pipelines and audits: SARIF for GitHub code scanning, JUnit, a --min-score gate, hrg diff between snapshots, findings mapped to ISO/IEC 27001, SOC 2 and DORA.
  • A report you can hand over: one offline HTML file with an interactive dependency map, readable on a phone and printable as PDF.

Why

Simple ratios hide the worst cases. HRG is designed so that they cannot:

Situation Naive metric Human Risk Graph
One person approves everything "inequality 0" (nothing to compare) 1.0 effective approvers, grade F
99 people depend on one critical lead 0.009 (diluted by headcount) bus factor 1, same risk at any size
A critical approver can be bypassed averaged away by good metrics counted as an independent way to fail

The model, its properties and its tests are in docs/model.md.

Quick start

Try it on the example organization, nothing to set up (needs uv):

curl -sO https://raw.githubusercontent.com/LF3551/human-risk-graph/main/examples/organization.yaml
uvx --from human-risk-graph hrg analyze organization.yaml
open organization_report.html   # xdg-open on Linux

Or install it:

pip install human-risk-graph
hrg analyze my-org.yaml
Human Risk Graph 0.6.0 · organization.yaml · 5 people · 5 dependencies

  Score  25/100  ██░░░░░░░░  F · Critical risk  model hrg-2

  Key people  bus factor 1 · losing Alice cuts off 2 people (67% of connections)
  Approvals   1.5 effective approvers of 2 · Alice holds 77%
  Overrides   2 of 3 critical approvals can be overridden

  Top fixes
  1  Require a second person for Bob's bypass of Alice  25 → 45  +20
  2  Add a deputy for Alice                             45 → 71  +26
  3  Add a deputy for Bob                               71 → 76   +5

  Findings  3 errors · 2 warnings
   ▲ HRG001 Alice (alice) is a single point of failure (criticality 0.90): losing them cuts off 2 people
            and 67% of the connections between the others.
   ▲ HRG002 Approval authority is concentrated (1.5 effective approvers of 2); Alice (alice) holds 77%
            of the approval weight.
   △ HRG003 Bob (bob) can bypass Alice (alice) and override the controls they enforce; one of them is
            critical.
   ...

HTML report

One self-contained file that works offline, in light and dark mode, on a phone and as a PDF: score and verdict, fix plan, interactive dependency map, people, findings with related controls, the exact formula, and an audit trail with the input file's SHA-256.

Human Risk Graph HTML report

What HRG measures

The score is built from three metrics (model hrg-2, see docs/model.md):

  • Key-person risk — how much of the organization depends on one person: losing them cuts off N people and X% of the connections between the others. Also reported as the classic bus factor.
  • Approval concentration — the effective number of approvers (Herfindahl-Hirschman index): one person approving everything is as concentrated as it gets.
  • Override exposure — the share of critical approvals someone can override through a bypass.

On top of the score, HRG simulates remediations (a deputy for a key person, a second-person check on a bypass) and lists the three that raise the score most.

The original model from the paper is still available as --model hrg-1.

Usage

Installation

# Install from PyPI (recommended)
pip install human-risk-graph

# Or install from source
git clone https://github.com/LF3551/human-risk-graph.git
cd human-risk-graph
pip install -e .

# With development tools
pip install -e ".[dev]"

Data Format

Describe your organization in a JSON or YAML file:

{
  "$schema": "https://raw.githubusercontent.com/LF3551/human-risk-graph/main/src/human_risk_graph/organization.schema.json",
  "people": [
    { "id": "A", "role": "SRE", "criticality": 0.9 },
    { "id": "B", "role": "Security Engineer", "criticality": 0.8 },
    { "id": "C", "role": "Manager", "criticality": 0.7 },
    { "id": "D", "role": "Developer", "criticality": 0.4 }
  ],
  "dependencies": [
    { "from": "A", "to": "B", "type": "approval", "weight": 0.8 },
    { "from": "C", "to": "A", "type": "bypass", "weight": 0.9 }
  ]
}

Fields:

  • people.id — unique identifier
  • people.role — job title (optional)
  • people.criticality — importance level (0.0-1.0)
  • dependencies.from/to — person IDs
  • dependencies.type — relationship type (approval, bypass, etc.)
  • dependencies.weight — dependency strength (0.0-1.0)

Invalid input (duplicate or unknown IDs, values outside 0.0-1.0) is rejected with an error that points to the offending entry.

YAML and editor support: files ending in .yaml or .yml are read as YAML (see examples/organization.yaml). The JSON Schema gives completion and validation in editors: reference it with "$schema" in JSON, or with # yaml-language-server: $schema=<url> at the top of a YAML file. hrg schema prints the schema.

CLI Usage

The easiest way to use HRG is through the command-line interface:

# Analyze an organization (generates JSON, Markdown, and HTML reports)
hrg analyze data/example_organization.json

# Generate only HTML report
hrg analyze data/example_organization.json --format html

# Specify output file
hrg analyze data/example_organization.json --format html --output my_report.html

# CI: SARIF and JUnit reports, fail if the score is below 70
hrg analyze examples/organization.yaml --format sarif --format junit --no-visualize --min-score 70

# Compare two snapshots (text, markdown or json)
hrg diff org-q1.yaml org-q2.yaml --format markdown

# Original model from the paper, no fix plan, only errors
hrg analyze data/example_organization.json --model hrg-1 --fixes 0 --quiet

# Generate interactive graph visualization only
hrg visualize data/example_organization.json

Exit codes: 0 success, 1 invalid input or error, 2 usage error, 3 score below --min-score, composite risk above --fail-above, or risk increased with hrg diff --fail-on-increase.

Each run writes the reports next to the input file: JSON (all results, findings and the fix plan), Markdown, the HTML report, and with --visualize (default) a standalone interactive graph.

Findings and Compliance Mapping

Every finding has a rule ID (HRG001 single point of failure, HRG002 concentrated approval authority, HRG003 bypass involving a critical person, HRG004 score above threshold) and related controls in ISO/IEC 27001:2022, SOC 2 and DORA. The mapping is informative, not a compliance assessment. See docs/compliance.md.

CI integration

GitHub Actions example: findings appear as code scanning alerts on the organization file, and the job fails when the score drops below 70.

name: Human risk
on:
  pull_request:
    paths: [org/organization.yaml]
permissions:
  contents: read
  security-events: write
jobs:
  hrg:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-python@v7
        with:
          python-version: "3.13"
      - run: pip install human-risk-graph
      - run: >
          hrg analyze org/organization.yaml
          --format sarif --format junit --no-visualize --min-score 70
      - uses: github/codeql-action/upload-sarif@v4
        if: always()
        with:
          sarif_file: org/organization_report.sarif

The JUnit report (org/organization_report.junit.xml) has one test case per rule and works with any CI system that shows test results. To show what a change does to the scores, compare against the base branch:

git show origin/main:org/organization.yaml > /tmp/base.yaml
hrg diff /tmp/base.yaml org/organization.yaml --format markdown >> "$GITHUB_STEP_SUMMARY"

Python API Usage

from human_risk_graph import HumanRiskGraph

# Load your organization data
people = [...]
dependencies = [...]

# Create and analyze
hrg = HumanRiskGraph(people, dependencies)
results = hrg.calculate()  # model="hrg-1" for the original model

print(f"Score: {results['score']}/100 ({results['grade']}, {results['risk_level']} risk)")
print(f"Bus factor: {results['bus_factor_people']}")
print(f"Effective approvers: {results['effective_approvers']:.1f}")

for fix in hrg.fix_plan():
    print(f"{fix['title']}: {fix['score_before']} -> {fix['score_after']}")

Development

  • src/human_risk_graph/ — the package (model, CLI, reports)
  • tests/ — unit, property and CLI tests
  • docs/ — formal model, compliance mapping, figures
  • examples/, data/ — example organizations and generated reports
  • experiments/ — synthetic data and benchmarks from the paper
  • paper/ — LaTeX source of the paper
# Run tests
pytest tests/ -v

# Run tests with coverage
pytest tests/ --cov=human_risk_graph --cov-report=html

# Code formatting
black src/ tests/ --line-length 100

# Linting
flake8 src/ tests/

# Run experiments
python experiments/generate_data.py
python experiments/run_experiments.py
python experiments/visualize.py

Use Cases

Best suited for: Organizations with 50+ employees, formal security processes, or compliance requirements.

  • Security architecture analysis
  • Business continuity planning (SOC2, ISO27001 audits)
  • Insider threat assessment
  • M&A due diligence (key person risk)
  • Organizational risk modeling

Note: For small teams (<20 people), managers typically have direct visibility into dependencies. HRG provides the most value when organizational complexity exceeds intuitive understanding.

Status

HRG is in beta (0.x): the metrics and the input format may still change between minor releases. Scores support risk discussions and audits; they do not replace a full risk assessment.

Citation

If you use this software in your research or work, please cite:

@software{aleinikov_2026_hrg,
  author       = {Aleinikov, Aleksei},
  title        = {Human Risk Graph: A Quantitative Model for Organizational Security Risk},
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.18288055},
  url          = {https://doi.org/10.5281/zenodo.18288055}
}

Or use this text citation:

Aleinikov, A. (2026). Human Risk Graph: A Quantitative Model for Organizational Security Risk. Zenodo. https://doi.org/10.5281/zenodo.18288055

The DOI above always resolves to the latest release; each release also gets its own version DOI on Zenodo.

To cite the model itself, use the paper:

@article{aleinikov_2026_hrg_paper,
  author       = {Aleinikov, Aleksei},
  title        = {Human Risk Graph: A Quantitative Model for Organizational Security Risk},
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.20260930},
  url          = {https://doi.org/10.5281/zenodo.20260930}
}

License

Licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Metadata

Release files for human-risk-graph 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for human-risk-graph 0.6.0
File Size Uploaded Provenance Actions
human_risk_graph-0.6.0.tar.gz 73.1 kB With provenance Details for human_risk_graph-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for human-risk-graph 0.6.0
File Interpreter ABI Platform Actions
human_risk_graph-0.6.0-py3-none-any.whl Python 3 none any Details for human_risk_graph-0.6.0-py3-none-any.whl

Total release size: 134.2 kB

Release files / human_risk_graph-0.6.0.tar.gz

Download URL human_risk_graph-0.6.0.tar.gz
Size 73.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cca9655e52d08ce834a4a325689561d47c4dd129333dc64a45a7c6352acf9c17
BLAKE2b-256 checksum
How to use checksums
5cce868a2494b4fdef46fd64a1a567de9931ba4a5d15fd33967832242eca0cb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / human_risk_graph-0.6.0-py3-none-any.whl

Download URL human_risk_graph-0.6.0-py3-none-any.whl
Size 61.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e273465c223abbcaab311d8cde99628cae9f57f1417b8c86ca34d68e6993942
BLAKE2b-256 checksum
How to use checksums
322976e1e7051eddda0993705205dfdc9dd1bd061f5528fdf60c3621d6f41aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for human-risk-graph 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for human_risk_graph-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page