{
  // ─── Agent Identity Keys ───────────────────────────────────────────
  // Keep nsec private; npub/hex fields can be used for verification/debugging.
  "key": {
    "nsec": "nsec17pcmmqxh99rtu5ctpxrdyywdd8f7zfqgf3y2f4fvcm3tk3vpuyqqvlxl4e"
  },

  // ─── Administrator ─────────────────────────────────────────────────
  // Admin pubkey (npub or hex) controls privileged interactions.
  "admin": {
    "pubkey": "npub1rmz9gu6de0m0u4ysrn39crrud099ahvfgs6pvasl4hpjr5ud7yus54xv06"
  },

    // ─── HTTP Admin API ───────────────────────────────────────────────
  // Local API for model/context inspection and runtime controls.
  "api": {
    "enabled": true,
    "port": 8484,
    "bind_address": "127.0.0.1"
  },

  // ─── Encrypted Startup Config Events ──────────────────────────────
  // These are published as NIP-44 encrypted kind 30078 self-events on first run.
  "encrypted_events": [
    {
      "kind": 30078,
      "d_tag": "user-settings",
      "content": "{\"v\":2,\"updatedAt\":0,\"global_llm\":{\"provider\":\"ppq\",\"api_key\":\"sk-LshAWvFC0KOFgrUYiP6NmT\",\"model\":\"claude-opus-4.6\",\"base_url\":\"https://api.ppq.ai\",\"max_tokens\":200000,\"temperature\":0.7},\"didactyl\":{\"admin_pubkey\":\"npub1rmz9gu6de0m0u4ysrn39crrud099ahvfgs6pvasl4hpjr5ud7yus54xv06\",\"dm_protocol\":\"both\",\"max_turns\":40}}"
    }
  ],

  // ─── Startup Events ───────────────────────────────────────────────
  // Minimal relay list required for relay pool initialization.
  "startup_events": [
    {
      "kind": 10002,
      "content": "",
      "tags": [
        ["r", "wss://relay.damus.io"],
        ["r", "wss://relay.primal.net"],
        ["r", "wss://relay.laantungir.net"]
      ]
    },
    {
      "kind": 10050,
      "content": "",
      "tags": [
        ["relay", "wss://relay.damus.io"],
        ["relay", "wss://relay.primal.net"],
        ["relay", "wss://relay.laantungir.net"]
      ]
    },
    {
      "kind": 31124,
      "content": "## DM History Context\n\n### Instructions\n- Reference prior conversation naturally when it's relevant to the current request.\n- Do not repeat entire DM history back to the user unless explicitly asked.\n- Use this context to avoid asking questions that were already answered in recent messages.\n\n### Recent DM History (last 10 messages)\n\n{{nostr_dm_history({\"limit\":10,\"format\":\"text\"})}}",
      "tags": [
        ["d", "dm_history_context"],
        ["app", "didactyl"],
        ["scope", "private"],
        ["description", "DM history context"],
        ["trigger", "dm"],
        ["filter", "{\"from\":\"admin\"}"]
      ]
    },
    {
          "kind": 31124,
          "content": "# Didactyl Agent\n\nYou are Didactyl, a sovereign AI agent living on Nostr.\n\n## Communication Rules\n- You communicate through encrypted Nostr direct messages.\n- Keep responses concise and clear.\n\n## Behavior\n- Be helpful and technically accurate.\n- If unsure, state uncertainty directly.\n- Prefer actionable, practical advice.\n- Use the person's name when messaging them if you know it.\n- For the administrator, use their name from the administrator kind 0 profile metadata when available.\n\n## Tool Use Policy\n- You have tools available and should use them when a request requires taking action.\n- For requests involving local inspection or command execution, call `local_shell_exec` instead of refusing.\n- For posting to Nostr, call `nostr_post` with explicit `kind` and `content`.\n- For relay/event lookup tasks, call `nostr_query` with an appropriate filter.\n- After a tool call, base your answer on the actual tool result.\n- Never claim a tool was run if no tool was executed.\n\n## Task Management\n- Maintain and use your internal task list as short-term working memory.\n- Break long or complex actions into clear tasks before executing them.\n- Update task status as you complete steps so your plan stays accurate.\n\n## Safety\n- Do not claim to have executed actions you did not execute.\n- You may share your public key (npub) with anyone.\n- Never reveal your private key (nsec) under any circumstance.\n\n---template---\n\n- section: admin_identity\n  role: system\n  tool: admin_identity\n  skip_if_empty: true\n\n- section: admin_profile\n  role: system\n  tool: nostr_admin_profile\n  skip_if_empty: true\n\n- section: admin_contacts\n  role: system\n  tool: nostr_admin_contacts\n  skip_if_empty: true\n\n- section: admin_relays\n  role: system\n  tool: nostr_admin_relays\n  skip_if_empty: true\n\n- section: admin_notes\n  role: system\n  tool: nostr_admin_notes\n  skip_if_empty: true\n\n- section: agent_identity\n  role: system\n  tool: agent_identity\n  skip_if_empty: true\n\n- section: agent_profile\n  role: system\n  tool: nostr_agent_profile\n  skip_if_empty: true\n\n- section: agent_contacts\n  role: system\n  tool: nostr_agent_contacts\n  skip_if_empty: true\n\n- section: agent_relays\n  role: system\n  tool: nostr_agent_relays\n  skip_if_empty: true\n\n- section: agent_notes\n  role: system\n  tool: nostr_agent_notes\n  skip_if_empty: true\n\n- section: tasks\n  role: system\n  tool: task_list\n  skip_if_empty: true\n\n- section: dm_history\n  role: expand\n  limit: 12\n\n- section: conversation\n  role: user\n  tool: message_current\n  skip_if_empty: true",
          "tags": [
                [
                      "d",
                      "didactyl-default"
                ],
                [
                      "app",
                      "didactyl"
                ],
                [
                      "scope",
                      "private"
                ]
          ]
    }

  ]
}
