Implementation:AISecurityLab Hackagent Storage Records
| 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
- Repository: AISecurityLab_Hackagent
- File: hackagent/storage/records.py
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,
)