GEO INFER SEC

From ActiveInferenceInstitute/GEO-INFER · View interactive version

GEO INFER SEC is an AI agent skill from the GitHub repository ActiveInferenceInstitute/GEO-INFER. Security and threat detection for geospatial systems. Use when implementing spatial access control, authentication and TOTP-based MFA, geospatial data anonymization, security auditing, or encrypting spatial data.

How to use this skill

Skill file

GEO-INFER-SEC

Instructions

Core Capabilities

(RBAC + SBAC) via GeospatialAccessManager (JWT tokens, point-in-permission

checks, GeoDataFrame filtering).

authentication via AuthenticationManager (enable_mfa with a base32

secret; authentication is denied when MFA is enabled and no valid code is

supplied).

(behavioral), PhysicalSecurityManager, and IntegratedSecurityManager

(cross-domain correlation). Threat indicators are SIMULATION-ONLY, loaded

from a configurable YAML file — see DigitalSecurityManager docstring.

AuditLogger (log_authentication, log_authorization, log_data_access,

generate_compliance_report).

GeospatialAnonymizer (location_perturbation, spatial_k_anonymity,

geographic_masking); AES/Fernet encryption of text, JSON, coordinates, and

GeoDataFrames via GeospatialEncryption.

Key Imports

from geo_infer_sec.core.access_control import (
    GeospatialAccessManager,
    Role,
    SpatialPermission,
)
from geo_infer_sec.core.anonymization import GeospatialAnonymizer
from geo_infer_sec.core.authentication import AuthenticationManager
from geo_infer_sec.core.encryption import GeospatialEncryption
from geo_infer_sec.core.audit import AuditLogger
from geo_infer_sec.core.integrated_security import IntegratedSecurityManager

Examples

Spatially-scoped access control

mgr = GeospatialAccessManager(secret_key="demo-secret")
mgr.add_role(
    Role(
        name="analyst",
        permissions=[SpatialPermission(name="view", attributes=["value"])],
    )
)
mgr.assign_role_to_user("alice", "analyst")

payload = mgr.validate_token(mgr.generate_token("alice"))
print(payload["user_id"])                       # alice
print(mgr.can_access_location("alice", 40.75, -73.98))  # True / False

Anonymizing point data (EPSG:4326)

anon = GeospatialAnonymizer(seed=42)
perturbed = anon.location_perturbation(gdf, epsilon=100.0)  # meters, seeded
grouped = anon.spatial_k_anonymity(gdf, k=5, h3_resolution=8)
import base64

from geo_infer_sec.core.authentication import AuthenticationManager, generate_totp

auth = AuthenticationManager(secret_key="signing-secret")
auth.register_user("alice", "correct-horse-battery")
secret = base64.b32encode(b"0123456789abcdef").decode()
auth.enable_mfa("alice", secret)

auth.authenticate("alice", "correct-horse-battery")                 # denied: no code
code = generate_totp(secret)                                # RFC 6238 code
auth.authenticate("alice", "correct-horse-battery", mfa_code=code)  # TokenInfo

CLI

geo-infer-sec --help   # anonymize / encrypt / decrypt / check-compliance /
                       # audit / risk-assessment / generate-token

Agent interfaces

Use uv run --frozen geo-infer catalog SEC to discover public source

APIs, then geo-infer describe before calling a selected target. Scripts use

geo_infer_api.agent_runtime.AgentSession; the optional stdio MCP server is

geo-infer-mcp. See requests, native objects and composition.

The adapter retains this module's dependencies and authorization requirements.

Guidelines

degrees with a flat 111,000 m/deg factor; it raises on other CRS. Accuracy

degrades away from the equator.

loops are simulation-only defaults; wire real feeds via the

threat_indicators_file config before treating outputs as actionable.

Integrations

Flask blueprint; requires init_security_api(app, secret_key) before use).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.