Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AISecurityLab Hackagent Storage Records

From Leeroopedia
Knowledge Sources
Domains Storage, Contracts
Last Updated 2026-10-29 00:00 GMT

Overview

Concrete frozen pydantic record models mirroring server-side database fields, returned by every storage backend, provided by the HackAgent storage package.

Description

The records module defines immutable pydantic models: OrganizationContext' (org_id, user_id), AgentRecord (id, name, agent_type, endpoint, metadata, org, owner, timestamps), AttackRecord (id, type, agent_id, org, configuration, timestamp), CampaignRunRecord, RunRecord, ResultRecord, TraceRecord, and PaginatedResult (generic paginated list). canonical_attack_type() maps legacy attack type strings to canonical ids.

Usage

  • Storage backends: Both LocalBackend and RemoteBackend return these records.
  • TUI/Web UI: The UIs read these records to display results.

Code Reference

Source Location

Signature

class OrganizationContext(BaseModel):
    org_id: UUID
    user_id: str

class AgentRecord(BaseModel):
    id: UUID
    name: str
    agent_type: str
    endpoint: str
    metadata: Dict[str, Any]
    organization: UUID
    owner: str
    created_at: datetime
    updated_at: datetime

class AttackRecord(BaseModel):
    id: UUID
    type: str
    agent_id: UUID
    organization: UUID
    configuration: Dict[str, Any]
    created_at: datetime

def canonical_attack_type(value: str) -> str: ...

Import

from hackagent.storage.records import (
    OrganizationContext, AgentRecord, AttackRecord,
    RunRecord, ResultRecord, TraceRecord, PaginatedResult, canonical_attack_type,
)

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment