Skip to main content
Glama
PerspectiveGraph

PerspectiveGraph

PerspectiveGraph finds the routes an attacker could follow from the internet, through permissions that are too broad, to your sensitive data. It builds them from what you already have, the output of Trivy, Semgrep, Cloud Custodian and Falco plus your AWS accounts and Kubernetes clusters, then shows every hop of each route and writes the change that closes it. In a pull request, the check fails only when that change opens a route or makes one easier.

Say a scanner reports a critical CVE in a container. It is one finding among thousands, and nothing in the report says it matters more than the rest. PerspectiveGraph sees that the container sits behind a public load balancer and runs with a role that can read the production database, so that finding goes to the top of this week's list.

It is open source (Apache 2.0), runs on your infrastructure and sends no telemetry.

PerspectiveGraph: from the day's exploitable routes to a generated fix

make demo, on sample scanner output and seeded verdicts rather than a real environment.

Try it

The public demo is the same dashboard, read-only, on sample data. There is nothing to install.

To run it yourself, clone the repository. You need Docker, jq and curl:

make demo

This pulls the published, signed images, loads sample output from the scanners and the cloud, and prints the top attack path with its fix. The dashboard is at http://localhost:3000, and make down removes everything. The demo has no authentication, so keep it on your machine.

Related MCP server: emfirge

Check your own account in 30 seconds

You don't need to deploy anything for this. A single binary asks AWS's own policy evaluator which of your roles can end up as administrator, taking into account the service control policies, permission boundaries and condition keys that reading the policies alone would miss:

# macOS on Apple silicon; for other systems use linux_amd64, linux_arm64 or darwin_amd64
curl -sSL https://github.com/luiacuaniello/perspectivegraph/releases/latest/download/perspectivegraph_darwin_arm64.tar.gz | tar xz
./perspectivegraph redteam -roles -region eu-west-1

Each check is an iam:SimulatePrincipalPolicy dry run, so it changes nothing and costs nothing. The only permissions it needs are that one and iam:ListRoles, both in SecurityAudit. Windows builds are on the releases page. Every binary is signed with cosign and has SLSA provenance, and two commands verify them before you run anything.

Add -compare and it also runs the engine on the same account, exiting non-zero wherever the two disagree. That is how the engine's first real false positive was found and fixed. If they disagree on your account, please report it. To go further on your own estate, evaluating PerspectiveGraph works through it in stages that each end with an answer.

Fail the pull request that opens a route

The GitHub Action reads your AWS account (read-only), adds the scan from the pull request and asks the same question. Nothing needs to be deployed:

- uses: luiacuaniello/perspectivegraph@v1
  with:
    mode: local
    aws-region: eu-west-1     # read-only; give the job an OIDC role with SecurityAudit
    report: trivy.json

A critical CVE on a host that nothing routes to doesn't fail the build. A medium one on a container that can now reach the production database does. Routes that were already there, and that the change leaves as they were, don't count. When the scan never arrived, the result is unknown (exit 2) instead of a green tick; clean exits 0 and blocked exits 1.

The same gate checks Terraform plans (terraform show -json) before they are applied, runs as a CLI in any other CI (perspectivegraph gate) and installs as a Trivy plugin. The merge gate manual covers every option.

WARNING

Pull requests from forks get no secrets, so the gate fails closed asunknown on them. Don't work around it with pull_request_target: that runs your cloud credentials against the contributor's code. On a public repository a blocked check prints the route, with real asset names, in a public job log, so use soft-fail there and send the detail somewhere private.

Install

On Kubernetes, the chart is an official package on Artifact Hub:

helm install perspectivegraph oci://ghcr.io/luiacuaniello/charts/perspectivegraph \
  --set secrets.generate=true \
  --version 1.43.0 # x-release-please-version

A default install requires authentication. secrets.generate=true creates the credentials and keeps them across upgrades, and the chart's page lists the other choices.

On a single VM with Docker and a DNS name, make prod-init DOMAIN=perspectivegraph.example.com sets up TLS, credentials, a message bus with no port and daily backups (production on one machine). From there, connect your own infrastructure points it at your AWS accounts and clusters, and the operations runbook covers what a real rollout needs on top.

Ask it from an AI agent

Ask a language model for the attack paths in your account and it will make up plausible ones. With perspectivegraph mcp the agent asks the engine instead, over MCP:

perspectivegraph mcp --api https://demo.a3thinker.it   # the public demo needs no credentials

Every tool is read-only. The most useful one, simulate_fix, reruns the analysis with the edges you want to cut and reports what really changes. The server is listed in the MCP Registry, and the manual has the client setup.

How much to trust it

The engine and its API are complete, documented and tested. The scores are not calibrated yet: nobody has run it on a real estate, tested the routes it found and fed the results back. Read a score as what the model concludes from the evidence it has. Use it to find and cut routes, and don't put its percentage in front of a board. If you try it on yours, tell us how it went.

What is checked today:

  • In CI, make bench-cloudgoat runs four CloudGoat-style scenarios, two of which must produce no path. Precision and recall are 1.00 on all four. That makes it a regression gate; it says nothing about accuracy on your estate.

  • On a real AWS account, a set of labs (make redteam-aws, make reachability-lab-aws and the others) checks the engine's answers against what AWS actually does. They have caught real mistakes, a permissions boundary the engine ignored among them, and each one was fixed. The dashboard's Accuracy page lists every question with AWS's answer, the engine's and the version asked.

  • AWS is live and verified. Azure runs on fixtures only, and there is no GCP or OpenStack connector yet; the roadmap says what is planned.

Out of the box it opens no outbound connection: GitHub, the AI assistant and the KEV/EPSS feeds stay off until you configure them. It is not a scanner, a CNAPP or a compliance product, and it replaces none of them. Positioning lists what it claims and what it doesn't.

PerspectiveGraph is written by a human working with Claude (Anthropic). The design decisions and what ships are the maintainer's; much of the code and its tests came out of that collaboration. So check it rather than trust it: make test, make bench-cloudgoat, govulncheck ./..., and CONTRIBUTING.

Documentation

The manual is at docs.a3thinker.it, one page per subject, with search. Good places to start:

License

Apache License 2.0. Every file declares its license in the form REUSE defines, and CI checks it: REUSE.toml.

Available Tools

8 tools
explain_attack_pathA
Read-onlyIdempotent

Give the full kill chain for one route: every hop, the relationship type, that hop's probability, where the probability came from (kev/epss/runtime are observed evidence; cvss/severity/heuristic are estimates), and the MITRE ATT&CK technique. Use this before explaining or acting on a route - the hop provenance is what tells you which parts of the story are evidence and which are assumption.

Inputs: path_id (required). Returns: id, nodes, score, steps, +16 more

get_postureA
Read-onlyIdempotent

Summarize the environment: how many attack routes are open, how many are runtime-confirmed, how many assets and relationships are mapped, and which sensitive assets an attacker can currently reach. Start here to orient before enumerating anything: it also gives the names the other tools take - the sensitive assets routes_to_target accepts and the applications app arguments accept.

Inputs: no named parameters. Returns: posture, applications, riskSimulation

get_score_trustA
Read-onlyIdempotent

Report how well the engine's probabilities have matched reality, measured against recorded red-team or BAS outcomes: the verdict (well-calibrated / calibrated-on-average / overconfident / underconfident / insufficient-data; calibrated-on-average means only the average matches, so no individual score may be quoted as a probability), the predicted-versus-observed rates, and what to do about the gap. Call this before quoting any score as a probability. If it reports insufficient-data, the numbers are expert estimates and must be presented as the model's own estimate, not as odds. It also reports discrimination - whether the score, and separately the triage Priority order, put confirmed paths above refuted ones (AUC with a 95% interval). Do not present the ranking as evidence of which path is most dangerous unless priorityDiscrimination reads 'discriminates'; 'insufficient-data' or 'indistinguishable-from-chance' means the order has not been shown to beat a coin, and must be said so.

Inputs: no named parameters. Returns: validation, calibration

list_attack_pathsA
Read-onlyIdempotent

List the ranked routes from internet exposure to a sensitive asset, highest triage priority first. score is the modelled end-to-end exploit probability and priority (0-100, banded P1/P2/P3) is the triage order that also weighs corroboration and target sensitivity. IMPORTANT: these probabilities are expert estimates, not measurements calibrated against real outcomes - call get_score_trust before presenting any of them as a probability, and prefer the ranking over the absolute values. It returns one page: when nextOffset is not null more routes exist, and passing it as offset returns the next ones. Routes an analyst has suppressed are listed too, marked suppressed.

Inputs: app, limit, offset. Returns: offset, nextOffset, attackPaths

list_fixesA
Read-onlyIdempotent

Return the remediation plan: the fewest changes that remove the most risk, choke points first, each with the share of critical-path risk it eliminates and how many routes it cuts. This is usually the right answer to 'what should we do' - a hundred routes typically collapse into a handful of changes.

Inputs: app. Returns: remediationPlan

routes_to_targetA
Read-onlyIdempotent

Enumerate the k best distinct routes that reach a named sensitive asset. Answers 'how many ways in are there, and do they share a choke point' - which single-path views hide. Cutting a hop that every route traverses removes them all; cutting one that appears in a single route removes one. Each route comes with its hops, ready to hand to simulate_fix. It returns the best k and has no further page.

Inputs: target (required), k, from. Returns: kShortestPaths

search_assetsA
Read-onlyIdempotent

Full-text search across indexed assets and findings by name, CVE id, or keyword. Use it to resolve a name a human mentioned into the node ids the other tools take. It needs OpenSearch on the deployment: where that is off it answers with an error saying so, never with an empty list, and get_posture and list_attack_paths are then where names come from. It returns the best size matches and has no further page: narrow the query instead.

Inputs: query (required), size. Returns: search

simulate_fixA
Read-onlyIdempotent

Ask what actually happens if specific relationships are cut: re-runs the whole simulation with those edges removed and reports how many routes disappear and how the compromise probability moves. This is the tool to reach for before recommending a change - it is a deterministic counterfactual over the real graph, not an estimate, so it settles 'would this help' instead of arguing about it. It changes nothing: the graph, the environment and every recorded decision stay as they are, so it needs no confirmation and can be repeated freely.

Inputs: cuts (required). Returns: whatIf

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a distinct role: get_posture orients, list_attack_paths enumerates globally, explain_attack_path details one route, routes_to_target enumerates to a named asset, list_fixes gives remediation, search_assets resolves names, get_score_trust reports calibration, and simulate_fix runs counterfactuals. The descriptions explicitly disambiguate the potentially overlapping route tools (global listing vs target-specific k-best vs single-route detail) and when to reach for each.

    Naming Consistency4/5

    Seven of eight names follow a clean snake_case verb_noun pattern (get_posture, list_attack_paths, explain_attack_path, list_fixes, search_assets, get_score_trust, simulate_fix). Only routes_to_target breaks the convention with a noun_to_noun form, a minor deviation but still readable.

    Tool Count5/5

    Eight tools is well-scoped for an attack-path exposure analysis domain, with each tool covering a genuine capability (orientation, enumeration, detail, target analysis, remediation, search, calibration, simulation). No tool feels redundant or padded.

    Completeness4/5

    Coverage of the analysis lifecycle is strong: orient, enumerate, explain, remediate, verify, and self-assess score trust. Minor gaps exist—no tool manages the analyst suppression referenced by list_attack_paths, and there is no export/report operation—but core workflows are complete for a read-only analytical surface.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      A local-first AWS security tool that uses graph theory to discover attack paths (e.g., Internet → Role → DB) and prioritize remediations. It allows agents to perform read-only security audits and generate Terraform fixes without data exfiltration.
      15
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to query a local code graph over stdio, so they can see what a Git change may affect, find related tests, routes and nodes, and cite evidence paths — read-only and fully on-machine.
      MIT