Skip to content

Feature/report mailbox - #22

Merged
dalpan merged 6 commits into
mainfrom
feature/report-mailbox
Oct 31, 2026
Merged

dalpan merged 6 commits into
mainfrom
feature/report-mailbox

Conversation

@dalpan

@dalpan dalpan commented Oct 31, 2026

Copy link
Copy Markdown
Owner

No description provided.

Danang Avan Maulana and others added 6 commits October 30, 2026 14:10
One screen that tells the measure -> remediate -> retest story:

- GET /api/readiness (trainer/admin, org-scoped like live campaigns):
  readiness index with its components and weights, report-rate trend over
  the last campaigns, remediation-loop funnel, average resistance per
  Cialdini principle, lab discrimination (Inbox Triage d'), and the
  attack-surface posture with the easiest crown jewel.
- The index is transparent: report rate 40%, did-not-click 20%, principle
  resistance 20%, triage 20%; components without data are left out and
  the weights renormalised.
- Cohort-level only (G13): the activity feed carries source, principle,
  status and date — no person, no free-text reason; the top attack path
  shows the asset, not the entry person.
- ReadinessPage becomes "/" for admins and trainers; Command Center moves
  to /command. Remaining hard-coded nav labels go through i18n.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admin-only "Demo data" card in Settings (GET/POST/DELETE /api/demo) loads a
fictional organization on the sandbox domain demo.test: 12 people, three
campaigns over three months (report rate 25% -> 50% -> 75%, click rate
42% -> 8%, faster reports), remediation and retests for everyone who
clicked, Inbox Triage results, risk profiles with authority as the weak
spot, and an attack-surface map.

- Deterministic: the same numbers on every load; reloading replaces it.
- Removable: every record is tagged demo: True; clearing never touches
  real data. The admin's own map is only seeded when it is empty, and only
  the maps the demo seeded are removed (tracked in demo_state).
- Demo people get a random, discarded password and cannot log in.
- Load and clear are recorded in the audit log.

Readiness: the headline report rate and the index now use the latest
campaign (readiness now); the all-campaign aggregate stays as context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ediation

- POST /api/triage lets trainers add triage sets (validated: id pattern,
  4-40 items, must mix pretexts and legitimate messages, every pretext
  needs a principle and explanation); audited.
- Triage Inbox renders WhatsApp/SMS items as a phone chat and offers a
  set picker when more than one set exists.
- Remediation assignments carry reason_key/reason_params so the reason is
  translated in the UI instead of stored as English text.
- Remediation prefers content sharing context tags with the failed
  exercise and never re-assigns the exercise that was just failed;
  retests follow the same rule.
- Scenario debrief keeps line breaks; removed duplicate untranslated
  "Try another scenario" button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…omatically

Staff forward a suspicious email to a configured report mailbox (e.g.
lapor@acme.test). The poller reads it alongside the reply mailbox, pulls the
original sender and subject out of inline, attached or HTML-only forwards,
and feeds the report inbox, so reporting a simulation now raises the
campaign's report rate without a trainer recording it by hand.

- live config: report_imap_user / report_imap_password (masked); rejected
  when equal to the reply mailbox, since replies would count as reports.
- GET /report-inbox/mailbox and POST /report-inbox/poll for staff;
  POST /live/poll now polls both mailboxes.
- Classification prefers the newest matching campaign the reporter actually
  received and has not reported yet, so campaigns that reuse a sender or
  subject credit the right one.
- Mailbox-path reports are filed under the campaign's (or reporter's) org.
- Report inbox page shows the address and a "check now" button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nguage, and handle refusals

- The persona prompt now includes the original lure (HTML stripped, GoPhish
  {{.URL}} shown as [link]); previously the model was asked to continue a
  thread it could not see.
- History holds only what the recipient saw: their messages and replies that
  were actually sent (no unapproved or discarded drafts).
- The persona answers in the language the recipient wrote in, falling back to
  the campaign language.
- A model refusal or empty output is retried once; if it persists, an empty
  draft marked persona_declined is queued so the reviewer writes the turn,
  instead of queueing the refusal text or a blank email.
- Approving a draft with an empty body is rejected (400).
- Review queue includes the campaign name and the message being answered;
  Reply Review page localized (EN/ID) and shows the declined state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(live): persona replies keep the thread, follow the recipient's language, and handle refusals
@dalpan
dalpan merged commit 16170f6 into main Oct 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant