Skip to content

armgit / Cairn

Public Imported from GitHub
0

Cairn is a general-purpose AI state-space search engine, validated first on autonomous penetration testing. Sometimes misspelled as Carin.

fix: 有些模型在 conclude 阶段仍然继续探索,优化提示词强调一下

leixiaoa026086046ac
diff --git a/cairn/src/cairn/dispatcher/prompts/default/bootstrap.md b/cairn/src/cairn/dispatcher/prompts/default/bootstrap.md
index 11ae7d7..56193f2 100644
--- a/cairn/src/cairn/dispatcher/prompts/default/bootstrap.md
+++ b/cairn/src/cairn/dispatcher/prompts/default/bootstrap.md
@@ -16,6 +16,7 @@ Only return the following after you have confirmed that Goal has been satisfied:
# Rules
- If the problem is not yet solved, keep working and do not stop on your own.
+- If you later receive a conclude-phase instruction in the same session, that newer conclude instruction overrides this keep-working rule immediately. In conclude phase, you must stop exploring, stop waiting, stop running or planning further actions, and return the required summary JSON right away.
- `fact.description` must clearly state the confirmed key objective results. For example, in a CTF scenario, it may include multiple flags, shells, privilege proofs, key exploitation results, and similar evidence.
- `complete.description` should explain why the currently confirmed results are sufficient to prove that Goal has been achieved.
- Do not put long data blobs in `description`. Long data should be placed in a file and referenced from `description` instead.
diff --git a/cairn/src/cairn/dispatcher/prompts/default/bootstrap_conclude.md b/cairn/src/cairn/dispatcher/prompts/default/bootstrap_conclude.md
index ff2aed3..b96d833 100644
--- a/cairn/src/cairn/dispatcher/prompts/default/bootstrap_conclude.md
+++ b/cairn/src/cairn/dispatcher/prompts/default/bootstrap_conclude.md
@@ -1,6 +1,7 @@
# Task
You will receive a context bundle containing Origin, Goal, and Hints. You need to understand your starting point and the information already available (Origin and Hints), then become an expert in this domain.
But note that you are not continuing the task here. You do not need to wait for unfinished tasks or commands. You only need to summarize the key facts that have already been confirmed so far and are most helpful for reaching Goal.
+This is the conclude phase. It overrides any earlier instruction in the same session that told you to keep working, continue exploring, solve Goal, wait for command results, or perform more actions.
## Output Requirements
Return only one raw JSON object. Do not output anything else. The JSON must be valid, including proper escaping of quotation marks.
@@ -16,6 +17,10 @@ Normal return example:
```
## Rules
+- Stop immediately and produce the JSON now. Do not continue the task.
+- Do not run any more commands, make any more tool calls, inspect anything else, wait for any unfinished command, or try to obtain any additional information.
+- Base your answer only on information that has already been confirmed before this conclude prompt. If something has not already been confirmed, do not wait for it and do not include it.
+- This JSON summary is your final output for this phase. After outputting it, stop.
- `fact.description` must be an already confirmed objective factual conclusion. Do not output plans, guesses, or explanatory filler.
- Do not put long data blobs in `fact.description`. Long data should be placed in a file and referenced from `description` instead.
diff --git a/cairn/src/cairn/dispatcher/prompts/default/explore.md b/cairn/src/cairn/dispatcher/prompts/default/explore.md
index de1c0f5..9c04e40 100644
--- a/cairn/src/cairn/dispatcher/prompts/default/explore.md
+++ b/cairn/src/cairn/dispatcher/prompts/default/explore.md
@@ -17,6 +17,7 @@ Normal return example:
# Rules
- Exploring the direction of an Intent may be valuable or may fail. If you cannot get closer to Goal through this Intent, then end the task, but before ending, make sure you have thoroughly explored this Intent.
+- If you later receive a conclude-phase instruction in the same session, that newer conclude instruction overrides this exploration instruction immediately. In conclude phase, you must stop exploring, stop waiting, stop running or planning further actions, and return the required summary JSON right away.
- `description` must clearly state the confirmed key objective results. For example, in a CTF scenario, it may include multiple flags, shells, privilege proofs, key exploitation results, and similar evidence. Do not put long data blobs in `description`; long data should be placed in a file and referenced from `description` instead.
- `description` should contain only the latest incremental facts discovered. Do not repeat information already present in the graph snapshot, and do not include redundant details that do not help advance Goal.
diff --git a/cairn/src/cairn/dispatcher/prompts/default/explore_conclude.md b/cairn/src/cairn/dispatcher/prompts/default/explore_conclude.md
index db14cff..677f40f 100644
--- a/cairn/src/cairn/dispatcher/prompts/default/explore_conclude.md
+++ b/cairn/src/cairn/dispatcher/prompts/default/explore_conclude.md
@@ -1,6 +1,7 @@
# Task
You will receive a YAML snapshot of the task graph. In the YAML graph, facts represent key objective facts, and intents represent exploration intents. The graph always moves from one or more facts to a new fact by proposing an intent for exploration. You need to interpret the graph information, understand the overall situation and progress, then become an expert in this domain.
But note that you are not continuing the task here, and you do not need to wait for unfinished tasks or commands. You only need to summarize the key facts that have already been confirmed so far and are most helpful for reaching Goal.
+This is the conclude phase. It overrides any earlier instruction in the same session that told you to keep working, continue exploring, solve Goal, wait for command results, or perform more actions.
# Output Requirements
Return only one raw JSON object. Do not output anything else. The JSON must be valid, including proper escaping of quotation marks.
@@ -16,6 +17,10 @@ Normal return example:
```
# Rules
+- Stop immediately and produce the JSON now. Do not continue the task.
+- Do not run any more commands, make any more tool calls, inspect anything else, wait for any unfinished command, or try to obtain any additional information.
+- Base your answer only on information that has already been confirmed before this conclude prompt. If something has not already been confirmed, do not wait for it and do not include it.
+- This JSON summary is your final output for this phase. After outputting it, stop.
- `description` must be an already confirmed objective factual conclusion. Do not output plans, guesses, or explanatory filler. Do not put long data blobs in `description`; long data should be placed in a file and referenced from `description` instead.
- `description` should contain only the latest incremental facts discovered. Do not repeat information already present in the graph snapshot, and do not include redundant details that do not help advance Goal.