scamscript 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. scamscript-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
  2. scamscript-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. scamscript-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +30 -0
  4. scamscript-0.2.0/.github/SECURITY.md +40 -0
  5. scamscript-0.2.0/.github/pull_request_template.md +11 -0
  6. scamscript-0.2.0/.github/workflows/ci.yml +27 -0
  7. scamscript-0.2.0/.github/workflows/release.yml +69 -0
  8. scamscript-0.2.0/.gitignore +9 -0
  9. scamscript-0.2.0/CHANGELOG.md +45 -0
  10. scamscript-0.2.0/CITATION.cff +20 -0
  11. scamscript-0.2.0/CODE_OF_CONDUCT.md +21 -0
  12. scamscript-0.2.0/CONTRIBUTING.md +54 -0
  13. scamscript-0.2.0/LICENSE +21 -0
  14. scamscript-0.2.0/PKG-INFO +278 -0
  15. scamscript-0.2.0/README.md +222 -0
  16. scamscript-0.2.0/docs/banner.svg +66 -0
  17. scamscript-0.2.0/docs/calibration.md +184 -0
  18. scamscript-0.2.0/docs/demo.gif +0 -0
  19. scamscript-0.2.0/docs/sample-report.md +403 -0
  20. scamscript-0.2.0/docs/social-preview.png +0 -0
  21. scamscript-0.2.0/examples/adversarial/fake_output_json.txt +39 -0
  22. scamscript-0.2.0/examples/adversarial/fence_escape.txt +34 -0
  23. scamscript-0.2.0/examples/adversarial/fixed_attack_type.txt +34 -0
  24. scamscript-0.2.0/examples/adversarial/non_json_demand.txt +36 -0
  25. scamscript-0.2.0/examples/adversarial/print_system_prompt.txt +31 -0
  26. scamscript-0.2.0/examples/adversarial/role_switch.txt +32 -0
  27. scamscript-0.2.0/examples/adversarial/score_override.txt +36 -0
  28. scamscript-0.2.0/examples/crude_robocall.txt +17 -0
  29. scamscript-0.2.0/examples/gov_impersonation_vishing.txt +63 -0
  30. scamscript-0.2.0/examples/prompt_injection_script.txt +40 -0
  31. scamscript-0.2.0/examples/romance_scam_sms.txt +93 -0
  32. scamscript-0.2.0/examples/sophisticated_wire_fraud.txt +74 -0
  33. scamscript-0.2.0/examples/tech_support_scam.txt +67 -0
  34. scamscript-0.2.0/pyproject.toml +68 -0
  35. scamscript-0.2.0/scripts/calibrate.py +117 -0
  36. scamscript-0.2.0/scripts/injection_eval.py +133 -0
  37. scamscript-0.2.0/src/scamscript/__init__.py +3 -0
  38. scamscript-0.2.0/src/scamscript/__main__.py +4 -0
  39. scamscript-0.2.0/src/scamscript/analysis.py +138 -0
  40. scamscript-0.2.0/src/scamscript/cli.py +521 -0
  41. scamscript-0.2.0/src/scamscript/client.py +207 -0
  42. scamscript-0.2.0/src/scamscript/config.py +55 -0
  43. scamscript-0.2.0/src/scamscript/ingest.py +85 -0
  44. scamscript-0.2.0/src/scamscript/models.py +169 -0
  45. scamscript-0.2.0/src/scamscript/prompts.py +90 -0
  46. scamscript-0.2.0/src/scamscript/redact.py +62 -0
  47. scamscript-0.2.0/src/scamscript/render.py +232 -0
  48. scamscript-0.2.0/src/scamscript/report.py +196 -0
  49. scamscript-0.2.0/src/scamscript/store.py +187 -0
  50. scamscript-0.2.0/src/scamscript/verify.py +103 -0
  51. scamscript-0.2.0/tests/test_analysis.py +202 -0
  52. scamscript-0.2.0/tests/test_cli.py +313 -0
  53. scamscript-0.2.0/tests/test_client.py +278 -0
  54. scamscript-0.2.0/tests/test_ingest.py +87 -0
  55. scamscript-0.2.0/tests/test_models.py +104 -0
  56. scamscript-0.2.0/tests/test_prompts.py +22 -0
  57. scamscript-0.2.0/tests/test_redact.py +55 -0
  58. scamscript-0.2.0/tests/test_render.py +105 -0
  59. scamscript-0.2.0/tests/test_report.py +79 -0
  60. scamscript-0.2.0/tests/test_store.py +40 -0
  61. scamscript-0.2.0/tests/test_verify.py +75 -0
@@ -0,0 +1,46 @@
1
+ name: Bug report
2
+ description: Something broke, or a breakdown is unusable
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ For security problems use the private advisory link instead.
9
+ Never paste a live API key.
10
+ - type: input
11
+ id: version
12
+ attributes:
13
+ label: Version or commit
14
+ placeholder: output of `scamscript --version` or `git rev-parse --short HEAD`
15
+ validations:
16
+ required: true
17
+ - type: dropdown
18
+ id: command
19
+ attributes:
20
+ label: Command
21
+ options: [analyze, batch, report, history, prune, other]
22
+ validations:
23
+ required: true
24
+ - type: input
25
+ id: provider
26
+ attributes:
27
+ label: Endpoint and model
28
+ placeholder: base URL and model slug, key redacted
29
+ - type: textarea
30
+ id: steps
31
+ attributes:
32
+ label: Reproduction
33
+ description: Smallest command and script fragment that shows the problem
34
+ validations:
35
+ required: true
36
+ - type: textarea
37
+ id: expected
38
+ attributes:
39
+ label: Expected and actual
40
+ validations:
41
+ required: true
42
+ - type: textarea
43
+ id: logs
44
+ attributes:
45
+ label: Relevant log lines or error text
46
+ description: From ~/.scamscript/logs/, trimmed to the failing record
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security advisory
4
+ url: https://github.com/sjdsjadjajdjsa/scamscript/security/advisories/new
5
+ about: Private reports for injection, leakage and path issues.
@@ -0,0 +1,30 @@
1
+ name: Feature request
2
+ description: A new analysis field, output format or command
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: Problem
9
+ description: What can you not answer today?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: proposal
14
+ attributes:
15
+ label: Proposal
16
+ description: Where it fits in the flow, and what it changes in the schema or CLI
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: alternatives
21
+ attributes:
22
+ label: Alternatives considered
23
+ - type: checkboxes
24
+ id: checks
25
+ attributes:
26
+ label: Fit
27
+ options:
28
+ - label: Works offline for tests
29
+ - label: Keeps `--json` one object per line
30
+ - label: Does not need a new dependency (or the dependency is justified)
@@ -0,0 +1,40 @@
1
+ # Security policy
2
+
3
+ ## Reporting a problem
4
+
5
+ Open a private advisory through
6
+ [GitHub Security Advisories](https://github.com/sjdsjadjajdjsa/scamscript/security/advisories/new)
7
+ for anything that is not a plain bug. Include the version or commit, the command, and the smallest
8
+ reproduction you can manage.
9
+
10
+ Expect an acknowledgement within a week. This is a side project with no bounty.
11
+
12
+ ## What counts
13
+
14
+ - Prompt injection in a script that escapes the JSON contract or smuggles instructions into the
15
+ logged record.
16
+ - Log or report leakage of data the redactor claims to mask.
17
+ - Path handling problems in `--file`, `--dir` or `--output` (traversal, symlink surprises,
18
+ clobbering).
19
+ - Anything that makes an API key appear in output, logs or a commit.
20
+
21
+ ## What does not
22
+
23
+ - A model producing a wrong or shallow breakdown. That is a calibration issue, not a
24
+ vulnerability; see `docs/calibration.md`.
25
+ - A malicious script that the analyzer does not classify correctly.
26
+ - Findings in upstream libraries without a demonstration against this tool.
27
+
28
+ ## Handling keys and data
29
+
30
+ - The key is read from `API_KEY` or `--api-key` and never written to logs.
31
+ - Scripts leave the machine when you run an analysis. With `--redact`, likely identifiers are
32
+ masked first, but redaction is regex-based: names and free-form identifiers still reach the
33
+ provider.
34
+ - Logs under `~/.scamscript/logs/` contain model output, which can echo the script. Prune them or
35
+ point `--home` at disposable storage when working with sensitive captures.
36
+
37
+ ## Scope
38
+
39
+ Supported: the current `master`. There are no backports and no LTS branches. Scripts are treated
40
+ as untrusted input; the tool reads them and never executes them.
@@ -0,0 +1,11 @@
1
+ ## What and why
2
+
3
+ <!-- One paragraph. The problem, not the file list. -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] `pytest` passes, no network in tests
8
+ - [ ] New tolerance or validator behaviour has a test, including the failure path
9
+ - [ ] Schema changes touch models, prompt, render, report and the README field list
10
+ - [ ] Prompt or scoring changes include before/after calibration numbers
11
+ - [ ] No keys, logs, `.venv/` or real victim data in the diff
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install
21
+ run: python -m pip install -e ".[dev]"
22
+ - name: Test
23
+ run: python -m pytest
24
+ - name: Build wheel
25
+ run: python -m pip wheel . --no-deps -w dist
26
+ - name: Smoke the entry point
27
+ run: python -m scamscript --version
@@ -0,0 +1,69 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+ inputs:
8
+ repository:
9
+ description: Target index
10
+ type: choice
11
+ options: [pypi, testpypi]
12
+ default: testpypi
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.13"
25
+ - name: Build
26
+ run: |
27
+ python -m pip install --upgrade build twine
28
+ python -m build
29
+ - name: Check metadata
30
+ run: python -m twine check dist/*
31
+ - name: Smoke the wheel
32
+ run: |
33
+ python -m venv /tmp/smoke
34
+ /tmp/smoke/bin/pip install dist/*.whl
35
+ /tmp/smoke/bin/scamscript --version
36
+ - uses: actions/upload-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ testpypi:
42
+ needs: build
43
+ if: github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi'
44
+ runs-on: ubuntu-latest
45
+ environment: testpypi
46
+ permissions:
47
+ id-token: write
48
+ steps:
49
+ - uses: actions/download-artifact@v4
50
+ with:
51
+ name: dist
52
+ path: dist/
53
+ - uses: pypa/gh-action-pypi-publish@release/v1
54
+ with:
55
+ repository-url: https://test.pypi.org/legacy/
56
+
57
+ pypi:
58
+ needs: build
59
+ if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi')
60
+ runs-on: ubuntu-latest
61
+ environment: pypi
62
+ permissions:
63
+ id-token: write
64
+ steps:
65
+ - uses: actions/download-artifact@v4
66
+ with:
67
+ name: dist
68
+ path: dist/
69
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .pytest_cache/
8
+ .crush/
9
+ *.md.out
@@ -0,0 +1,45 @@
1
+ # Changelog
2
+
3
+ All notable changes are recorded here. Versions follow SemVer; the CLI surface and the JSON
4
+ schema are the things that count as public API.
5
+
6
+ ## Unreleased
7
+
8
+ ### Added
9
+
10
+ - Terminal demo GIF in the README, recorded against a local stub endpoint.
11
+
12
+ ## 0.2.0 - 2026-11-02
13
+
14
+ ### Added
15
+
16
+ - Quote verification: quoted claims in `opening_hook` and `red_flags` are matched against the
17
+ source and marked `close` or `missing`; `--strict-quotes` fails the run, `--no-verify` disables.
18
+ - `--json` output (one object per script on stdout), `--timeout`, `--retries`, `--max-tokens`.
19
+ - `prune` command and `store.prune` for log retention.
20
+ - `--redact` masking of emails, cards, SSNs, phone numbers and long digit runs.
21
+ - Adversarial fixture set and `scripts/injection_eval.py` harness.
22
+ - `scripts/calibrate.py` for adherence, latency, spread and cost measurement.
23
+ - `docs/calibration.md` with three recorded passes and their caveats.
24
+ - CI on Python 3.12 and 3.13, issue forms, PR template, code of conduct, citation metadata.
25
+
26
+ ### Changed
27
+
28
+ - Prompt fences the artifact as untrusted data and states embedded instructions cannot change the
29
+ output format.
30
+ - Sophistication anchors widened; 9-10 now reserved for the top decile.
31
+ - Reason-only replies: `length` with empty content is truncation, reasoning text is the partial and
32
+ a last-resort fallback.
33
+
34
+ ### Fixed
35
+
36
+ - Empty content and retryable statuses were treated as fatal; they now back off within `--retries`.
37
+ - README, banner and repository metadata rebuilt around scope and evidence.
38
+
39
+ ## 0.1.0 - 2026-11-01
40
+
41
+ ### Added
42
+
43
+ - First cut: `analyze`, `batch`, `report`, `history`, `--dry-run`, Rich panels, ranked markdown
44
+ reports, Pydantic schema with one repair retry, JSONL logging, three sample transcripts, tests,
45
+ and a pip-installable package with a `scamscript` entry point.
@@ -0,0 +1,20 @@
1
+ cff-version: 1.2.0
2
+ title: scamscript
3
+ message: If this tool contributes to published research, cite the repository at the version used.
4
+ type: software
5
+ authors:
6
+ - name: scamscript contributors
7
+ repository-code: https://github.com/sjdsjadjajdjsa/scamscript
8
+ license: MIT
9
+ abstract: >-
10
+ Reverse-engineering analyzer for leaked and public scam call scripts and vishing transcripts.
11
+ Turns a script into a validated breakdown of persona, hook, trust moves, urgency, escalation,
12
+ red flags and a counter-playbook.
13
+ keywords:
14
+ - security
15
+ - fraud
16
+ - vishing
17
+ - smishing
18
+ - social engineering
19
+ version: 0.1.0
20
+ date-released: 2026-11-01
@@ -0,0 +1,21 @@
1
+ # Code of conduct
2
+
3
+ Short version: be useful, be kind, assume the other person is trying.
4
+
5
+ ## Expected
6
+
7
+ - Critique the change, not the person.
8
+ - Say what evidence would change your mind.
9
+ - Accept that maintainers can say no to scope, even to good work.
10
+
11
+ ## Not expected
12
+
13
+ - Harassment, dogpiling, or gatekeeping over tooling choices.
14
+ - Pasting live API keys or embargoed victim data into issues.
15
+ - Drive-by rewrites with no test and no rationale.
16
+
17
+ ## Enforcement
18
+
19
+ Report problems through a GitHub issue or the security advisory link. A maintainer will confirm,
20
+ explain the call and, for repeat behaviour, limit participation. There is no committee and no
21
+ appeal process beyond asking again with new detail.
@@ -0,0 +1,54 @@
1
+ # Contributing
2
+
3
+ Small project, low ceremony. Two rules: keep tests offline, and treat prompt or schema changes as
4
+ behaviour changes.
5
+
6
+ ## Setup
7
+
8
+ ```bash
9
+ python -m venv .venv && . .venv/bin/activate
10
+ pip install -e ".[dev]"
11
+ pytest
12
+ ```
13
+
14
+ ## Before opening a PR
15
+
16
+ - `pytest` passes. The suite mocks HTTP with `httpx.MockTransport`; nothing may hit a real network
17
+ or need a key.
18
+ - New parser tolerance or validator behaviour comes with a test, including the failure path.
19
+ - Additions to the schema touch `models.py`, `prompts.py`, `render.py`, `report.py` and the README
20
+ field list together; a half-wired field is worse than none.
21
+ - Keep the CLI contract stable: global flags stay global, exit code 1 means at least one script
22
+ failed, and `--json` output stays one object per line on stdout.
23
+
24
+ ## Prompt and scoring changes
25
+
26
+ Prompts are code. If you change the analyst instructions or the sophistication anchors, run the
27
+ calibration harness against a live endpoint and paste the before/after numbers into the PR:
28
+
29
+ ```bash
30
+ API_KEY=... python scripts/calibrate.py --dir examples --repeat 3 \
31
+ --model deepseek/deepseek-v4.1-flash-1017 \
32
+ --base-url https://openrouter.ai/api/v1
33
+ ```
34
+
35
+ Reference figures live in `docs/calibration.md`. A change that raises repair rate or drops
36
+ first-attempt validity needs a justification beyond "the output reads nicer".
37
+
38
+ ## Samples
39
+
40
+ `examples/` holds fictional transcripts only. Mark the top of each file as fictional, keep brands
41
+ invented, and do not paste victim data that is still under an embargo. If you add a real transcript,
42
+ note its provenance in the header comment.
43
+
44
+ ## Style
45
+
46
+ - Standard library first; new dependencies need a pinned version and a reason.
47
+ - Type hints on public functions, `from __future__ import annotations` at the top.
48
+ - No comments that restate the code; explain the reason when it is not obvious.
49
+ - Keep user-facing strings plain and lowercase for errors, sentence case for help text.
50
+
51
+ ## Commits
52
+
53
+ One logical change per commit. Subject under 72 characters, imperative mood, body explains why.
54
+ Do not commit `.venv/`, logs or keys.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 scamscript contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.