Is semantic-kernel safe?
- Python dynamic code execution
- Python filesystem read
- Python network egress
semantic-kernel is an AI python_package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 5 risky constructs are reported for review. It can: delegated authentication, dynamic code execution, filesystem read, filesystem write and network egress — capabilities are what the code can do, not a verdict on intent. Risk score 0/100 (low).
semantic-kernel 1.44.1
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of semantic-kernel's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (5)
The code turns strings into live code at runtime (eval / new Function / exec).
self._template_compiler = Compiler().compile(self.prompt_template_config.template)
Why it matters: If those strings aren't fixed and trusted, they become a way to run arbitrary code.
Fix: Avoid evaluating dynamically constructed code; if unavoidable, ensure the input is a trusted constant and never derived from external data.
The component reads files from disk.
with open(file_path, encoding=encoding) as f:
"private_key": Path(self.client_cert_path).read_text(),
pem_bytes = Path(cert_path).read_bytes()
with open(json_gen_ai_config) as file:
with open(settings.filename, "rb") as audio_file:
with open(path, "rb") as audio_file:
data = path.read_bytes()
with open(file_path) as file:
with open(path, "rb") as image_file:
with open(validated_path, "rb") as data:
with open(config_path, encoding=encoding) as config_file:
with open(prompt_path, encoding=encoding) as prompt_file:
with open(object, encoding=encoding) as file:
with open(file_path, encoding=encoding) as f:
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
with open(path, "wb") as file:
with open(file_path, "w") as local_file:
with open(validated_path, "wb") as f:
Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
from urllib.parse import quote_plus
self.filters.append({field: quote_plus(value)})from aiohttp import ClientSession
ClientSession() as session,
ClientSession() as session,
from aiohttp import ClientSession
ClientSession() as session,
from httpx import AsyncClient, HTTPStatusError, RequestError
async with AsyncClient(timeout=5) as client:
from urllib.parse import quote_plus
from httpx import AsyncClient, HTTPStatusError, RequestError
async with AsyncClient(timeout=5) as client:
return f"?q={quote_plus(query)}&{'&'.join(f'{k}={v}' for k, v in params.items())}"self._session = session if session else aiohttp.ClientSession()
from urllib.parse import ParseResult, ParseResultBytes, quote, unquote, urlencode, urljoin, urlparse, urlunparse
parsed_base = urlparse(base_url)
full_path = urljoin(base_path, path.lstrip("/"))return urlunparse(parsed_base._replace(path=full_path))
request_url = urljoin(server_url, path.lstrip("/"))server = urlparse(server_url)
Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
An OAuth 2.0 / OpenID Connect delegated-authentication flow was detected (authorization-code / refresh-token / token-exchange grant, an OIDC authorize/discovery endpoint or id_token, or a delegation library). Tools authenticate with the end user's delegated, scoped credentials rather than a long-lived embedded service credential. (3 occurrence(s) shown as evidence).
from msal import ConfidentialClientApplication, PublicClientApplication
"""Get the MSAL token cache."""
# (the `x5t` JWT header value), which MSAL and Microsoft Entra ID mandate to be a SHA-1 digest for the
Fix: Delegated auth is a lower-blast-radius execution context than an embedded static credential. Confirm the requested scopes are minimal and that tokens are never logged or forwarded off-host.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →