agent-security-hardening
AFaffaan-m/ECC314k4,125 new stars in the last 7 days
CTF and lab playbook: challenge triage, the vulnerability battery, signal-driven exploration, exploit-and-solve phases, hypothesis kill rules, and the built-in CTF arsenal. Load when solving CTF, lab, sandbox, or intentionally vulnerable challenges.
This workflow is included automatically for explicit CTF requests and workspaces
with a challenge.md ledger. It can also be loaded with skill_manage
(action=load, name=ctf-workflow). The bundled ctf skill carries category-specific
techniques.
Before probing, read the challenge descriptions, attached files, provided hints,
and explicit scope. Create challenge.md in the session workspace using write;
do not overwrite an existing ledger. AlphaCode re-reads this file into each
system prompt, including after compaction. Keep its current-state summary short (under 12 KiB); archive raw transcripts separately.
Record: challenge IDs and objectives; exact hints with source attribution; authorized origins; observed headers and stack evidence; known credentials with their source (never publish them); endpoint/status map; open hypotheses with a discriminating next experiment and attempt budget; closed hypotheses and the evidence needed to reopen them; verified flags and platform confirmation. Checkpoint after every material finding and before changing hypotheses.
Read server headers first. X-Powered-By: Express is evidence to investigate,
not a conclusive fingerprint; do not assume Flask or any other stack without
corroboration. Revisit hints before trying increasingly obscure explanations.
For a corroborated Next.js or Node.js challenge, load nodejs-security with
skill_manage and apply the relevant framework controls within challenge scope.
Use ctf_web_recon for a bounded initial pass and evidence-selected same-origin
paths. If its schema is not advertised yet, discover it with tool_help first.
Its missing-page control helps detect wildcard 200/403 responses. Keep
200, redirects, 401, 403, 404, 429 and 5xx separate. A 403 is a forbidden response,
not proof that the requested route exists; compare a missing-route baseline.
Pause the affected remote path on a rate limit and continue independent local or
artifact analysis; resume remote checks only as challenge rules allow. Do not use
a server error alone as exploit evidence.
Start each hypothesis with a small batch of discriminating experiments (usually no more than three before reassessing); this is a checkpoint, not a hard cap. Extend the investigation when new evidence, a reachable state or a reduced search space makes further work useful and it remains within challenge rules and real resource limits. Three equivalent results trigger a control and reachability check, not automatic refutation. Masked or non-discriminating results remain inconclusive; changing a payload's spelling does not create a new hypothesis. Treat the runtime reminder after ten consecutive probing tool calls without an analysis/checkpoint as a cue to record new evidence and reassess reachability, controls and remaining budget—not as a forced stop or automatic pivot. Continue toward the verified challenge objective while a useful, permitted next step remains; pivot only when evidence and expected information gain justify it. Reopen a closed hypothesis only with recorded new evidence. Never turn failed guesses into unbounded password loops: use only credentials supported by challenge artifacts or hints, unless a finite search space is explicitly the challenge's intended task. Record its bound, scope, stop condition and time budget.
The checkpoint reminder prompts a ledger update and reassessment; it does not force a change of hypothesis or end the task. Continue with the next useful authorized experiment until the objective is verified, the user stops, or a concrete scope/operational blocker prevents progress. A per-pass timeout leaves partial observations available for the next pass; resume from the checkpoint when execution can continue.
Browser work uses a background tab owned by this session. After tab death or a timeout, inspect state before repeating an action. Never retarget the user's active tab, and never blindly replay eval, clicks, or submissions.
For CTFs, labs, sandboxes, intentionally vulnerable applications, and challenge environments, use an intensive, experiment-driven workflow within the established environment.
Activities may include:
Avoid unnecessary damage to the host beyond what is needed to solve the challenge.
Alphacode exposes wrappers for a CTF arsenal (verify advertised schemas and installed dependencies first): pwntools, radare2, ghidra, angr, binwalk, steghide, exiftool, volatility, tshark, z3, hashcat, john, plus the flag_scanner, challenge_classifier, and ctf_auto_solver helpers. Reach for the matching tool instead of hand-assembling bash equivalents; challenge_classifier is useful for a fast first pass and then run targeted tools yourself.
For artifact-driven category analysis and reproducible scripts, load this
skill's solver-engineering reference with skill_manage (action=read).
It covers local oracles, constrained search, remote adaptation and evaluation.
Initial budget: approximately 0–15 minutes.
Do not blindly fire every payload at every input. Prefer tests that distinguish competing hypotheses.
Approximate budget: 15–40 minutes.
Once a credible path is established:
Do not claim a solve based on a matching word or intermediate response. For protected-content challenges, compare the exact returned field or artifact with the public preview and a known challenge control. A lock flag, omitted byte count, blurred placeholder, reflected input, or success status does not demonstrate access to the hidden payload. Treat unequal or truncated captures without a verified challenge marker as inconclusive. Record a solve only when the recovered flag or required state satisfies the challenge's success check.
Record every hypothesis attempt in the challenge ledger, including the ones that produced nothing, with the observation that justifies moving on:
H<n> surface=<param|file|endpoint|function> mechanism=<sqli|ssti|lattice|...>
attempt: <what was sent, with the exact input bytes>
observed: <actual response / offset / trace / exit>
disposition: confirmed | failed | not_applicable | blocked
reopen_if: <new artifact, new hint, new decoded layer, reduced search space>
A failed entry is not permission to retry: it names what would have to change.
An attempt cut short by a timeout, a crash, or an uninstalled tool is blocked,
not failed — the mechanism is still untested, and treating a blocked attempt as
a failed one is how a solvable challenge gets abandoned. Similarly, a wildcard
200, a reflected payload, a matching word, or an error page is an observation,
never a solve.
Before moving from one hypothesis to an unrelated one, re-read the ledger. The most common wasted stretch in a challenge is re-deriving a negative already recorded two steps earlier; the second most common is abandoning a blocked mechanism that a one-line fix would have unblocked.
"No SQLi here", "that offset is wrong", "the binary strips the flag" are claims,
and a claim needs the observation behind it. If you cannot state the input and the
observed output, the entry is inconclusive — not failed. Keep the distinction
visible in the ledger, because an inconclusive entry is the one worth re-examining
with a materially different technique, and a genuinely failed one is not.
Before any brute force or enumeration, record the bound: the alphabet, the
length, the keyspace size, the time per attempt, and the resulting expected
duration. A search whose bound is unknown is not a plan, it is a stall. If the
bound exceeds the remaining budget, either reduce it with evidence (a hint, a
partial leak, a timing side channel) or record it as blocked with the bound —
do not start it and hope.
The objective is fast convergence, not attachment to the first theory.
AFaffaan-m/ECC314k4,125 new stars in the last 7 days
Audit the whole repo: find bugs, security holes and performance bottlenecks. Get a ranked report in plain English.
DIDietrichGebert/ponytail202k4,780 new stars in the last 7 days
GAgarrytan/gstack143k636 new stars in the last 7 days
Harden code against the OWASP Top 10: input handling, authentication, sessions and dependencies.
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
RUruvnet/RuView106k693 new stars in the last 7 days