config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config implements the static configuration connector: importing a manually defined architecture from YAML into the graph (PRD section 21).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(cfg *Config) (*graph.Graph, []string, error)

Build constructs a graph from a parsed configuration.

func Load

func Load(path string) (*graph.Graph, []string, error)

Load reads and validates a configuration file, returning the built graph. Any secret material found in the configuration is redacted and reported in the returned warnings.

func LoadFromBytes

func LoadFromBytes(data []byte) (*graph.Graph, []string, error)

LoadFromBytes parses and validates configuration data.

Types

type Config

type Config struct {
	Agents         []NodeDef `yaml:"agents"`
	MCPServers     []NodeDef `yaml:"mcp_servers"`
	Tools          []NodeDef `yaml:"tools"`
	Identities     []NodeDef `yaml:"identities"`
	Secrets        []NodeDef `yaml:"secrets"`
	Repositories   []NodeDef `yaml:"repositories"`
	CIPipelines    []NodeDef `yaml:"ci_pipelines"`
	CloudRoles     []NodeDef `yaml:"cloud_roles"`
	CloudResources []NodeDef `yaml:"cloud_resources"`
	Databases      []NodeDef `yaml:"databases"`
	Hosts          []NodeDef `yaml:"hosts"`
	APIs           []NodeDef `yaml:"apis"`
	Datasets       []NodeDef `yaml:"datasets"`

	// Nodes is a generic section where each entry carries an explicit type.
	Nodes []NodeDef `yaml:"nodes"`

	CrownJewels   []string  `yaml:"crown_jewels"`
	Relationships []EdgeDef `yaml:"relationships"`
	Edges         []EdgeDef `yaml:"edges"`
}

Config is the full agentgraph.yaml document.

type EdgeDef

type EdgeDef struct {
	Source       string         `yaml:"source"`
	Target       string         `yaml:"target"`
	Type         string         `yaml:"type"`
	Confidence   float64        `yaml:"confidence"`
	Risk         int            `yaml:"risk"`
	Metadata     map[string]any `yaml:"metadata"`
	Connector    string         `yaml:"connector"`
	SourceObject string         `yaml:"source_object"`
}

EdgeDef is a relationship definition.

type NodeDef

type NodeDef struct {
	ID          string         `yaml:"id"`
	Name        string         `yaml:"name"`
	Provider    string         `yaml:"provider"`
	Criticality int            `yaml:"criticality"`
	CrownJewel  bool           `yaml:"crown_jewel"`
	Metadata    map[string]any `yaml:"metadata"`

	// Type is only used in the generic nodes section.
	Type string `yaml:"type"`
}

NodeDef is a node definition inside a typed section or the generic nodes section.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL