Skip to content

Commit 2cb0851

Browse files
committed
1. Rename AgentSDK -> AgentSdk
2. Remove redundant constant comparison barriers. This is already happening by default by the taint tracking library.
1 parent e370af6 commit 2cb0851

6 files changed

Lines changed: 375 additions & 43 deletions

File tree

javascript/ql/lib/semmle/javascript/frameworks/OpenAI.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ module OpenAI {
207207
* This module retains only role-filtered sinks, callback-based sinks, and
208208
* unsafe agent detection that MaD cannot express.
209209
*/
210-
module AgentSDK {
210+
module AgentSdk {
211211
/** Gets a reference to the OpenAI Agents SDK module. */
212212
API::Node moduleRef() {
213213
result = API::moduleImport("@openai/agents")

javascript/ql/lib/semmle/javascript/security/dataflow/SystemPromptInjectionCustomizations.qll

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module SystemPromptInjection {
5656
PromptContentSink() {
5757
this = OpenAI::getSystemOrAssistantPromptNode().asSink()
5858
or
59-
this = AgentSDK::getSystemOrAssistantPromptNode().asSink()
59+
this = AgentSdk::getSystemOrAssistantPromptNode().asSink()
6060
or
6161
this = Anthropic::getSystemOrAssistantPromptNode().asSink()
6262
or
@@ -68,12 +68,6 @@ module SystemPromptInjection {
6868
}
6969
}
7070

71-
private class ConstCompareAsSanitizerGuard extends Sanitizer {
72-
ConstCompareAsSanitizerGuard() {
73-
this = DataFlow::MakeBarrierGuard<ConstCompareBarrierGuard>::getABarrierNode()
74-
}
75-
}
76-
7771
/**
7872
* Content placed in a message with `role: "user"` is not a system prompt
7973
* injection vector; it is intended user-role content.
@@ -91,20 +85,4 @@ module SystemPromptInjection {
9185
)
9286
}
9387
}
94-
95-
/**
96-
* A comparison with a constant, considered as a sanitizer-guard.
97-
*/
98-
private class ConstCompareBarrierGuard extends DataFlow::ValueNode {
99-
override EqualityTest astNode;
100-
101-
ConstCompareBarrierGuard() { astNode.hasOperands(_, any(ConstantString cs)) }
102-
103-
predicate blocksExpr(boolean outcome, Expr e) {
104-
outcome = astNode.getPolarity() and
105-
e = astNode.getLeftOperand() and
106-
e = astNode.getAnOperand() and
107-
not e instanceof ConstantString
108-
}
109-
}
11088
}

0 commit comments

Comments
 (0)