Agentic identity

From elophanto/EloPhanto · View interactive version

Agentic identity is an AI agent skill from the GitHub repository elophanto/EloPhanto. Designs identity, authentication, and trust verification systems for autonomous AI agents in multi-agent environments. Adapted from msitarzewski/agency-agents.

How to use this skill

Skill file

Triggers

Instructions

Agent Identity Infrastructure

Trust Verification and Scoring

Evidence and Audit Trails

Delegation and Authorization Chains

Critical Rules

Workflow

  1. Threat model the agent environment before writing any code. Answer: how many agents interact, do they delegate, what is the blast radius, who is the relying party, what is the key compromise recovery path, what compliance regime applies.
  2. Design identity issuance with proper key generation, verification endpoints, expiry policies, and rotation schedules.
  3. Implement trust scoring with observable behaviors, clear auditable logic, thresholds, and trust decay.
  4. Build evidence infrastructure with append-only store, chain integrity verification, attestation workflows, and independent verification tools.
  5. Deploy peer verification between agents with delegation chain verification and fail-closed authorization gates.
  6. Prepare for algorithm migration by abstracting cryptographic operations behind interfaces.

Advanced Capabilities

Deliverables

Agent Identity Schema

{
  "agent_id": "trading-agent-prod-7a3f",
  "identity": {
    "public_key_algorithm": "Ed25519",
    "public_key": "MCowBQYDK2VwAyEA...",
    "issued_at": "2026-03-01T00:00:00Z",
    "expires_at": "2026-06-01T00:00:00Z",
    "issuer": "identity-service-root",
    "scopes": ["trade.execute", "portfolio.read", "audit.write"]
  },
  "attestation": {
    "identity_verified": true,
    "verification_method": "certificate_chain",
    "last_verified": "2026-03-04T12:00:00Z"
  }
}

Trust Score Model

class AgentTrustScorer:
    def compute_trust(self, agent_id: str) -> float:
        score = 1.0
        if not self.check_chain_integrity(agent_id):
            score -= 0.5
        outcomes = self.get_verified_outcomes(agent_id)
        if outcomes.total > 0:
            failure_rate = 1.0 - (outcomes.achieved / outcomes.total)
            score -= failure_rate * 0.4
        if self.credential_age_days(agent_id) > 90:
            score -= 0.1
        return max(round(score, 4), 0.0)

    def trust_level(self, score: float) -> str:
        if score >= 0.9: return "HIGH"
        if score >= 0.5: return "MODERATE"
        if score > 0.0: return "LOW"
        return "NONE"

Delegation Chain Verification

class DelegationVerifier:
    def verify_chain(self, chain: list[DelegationLink]) -> VerificationResult:
        for i, link in enumerate(chain):
            if not self.verify_signature(link.delegator_pub_key, link.signature, link.payload):
                return VerificationResult(valid=False, failure_point=i, reason="invalid_signature")
            if i > 0 and not self.is_subscope(chain[i-1].scopes, link.scopes):
                return VerificationResult(valid=False, failure_point=i, reason="scope_escalation")
            if link.expires_at < datetime.utcnow():
                return VerificationResult(valid=False, failure_point=i, reason="expired_delegation")
        return VerificationResult(valid=True, chain_length=len(chain))

Evidence Record Structure

class EvidenceRecord:
    def create_record(self, agent_id, action_type, intent, decision, outcome=None):
        previous = self.get_latest_record(agent_id)
        prev_hash = previous["record_hash"] if previous else "0" * 64
        record = {
            "agent_id": agent_id, "action_type": action_type,
            "intent": intent, "decision": decision, "outcome": outcome,
            "timestamp_utc": datetime.utcnow().isoformat(),
            "prev_record_hash": prev_hash,
        }
        canonical = json.dumps(record, sort_keys=True, separators=(",", ":"))
        record["record_hash"] = hashlib.sha256(canonical.encode()).hexdigest()
        record["signature"] = self.sign(canonical.encode())
        self.append(record)
        return record

Success Metrics

Verify

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.