Let $\kappa$ be an inaccessible cardinal, meaning an uncountable regular strong-limit cardinal. Fix, uniformly for every ordinal $\alpha\leq\kappa$, first-order definable coding relations in $(V_\alpha,\in)$ for finite tuples, ordered pairs, relations, functions, and finite sequences of elements of $V_\alpha$, compatible with restriction from $V_\beta$ to $V_\alpha$ whenever $\alpha<\beta\leq\kappa$.
A $\kappa$-tree means a partially ordered set $(T,<_{T})$ equipped with a height map $\ell_T:T\to\kappa$ such that every level $T_\alpha:=\{t\in T:\ell_T(t)=\alpha\}$ is nonempty and has cardinality $<\kappa$, every predecessor set $\{s\in T:s<_{T}t\}$ is well-ordered by $<_{T}$ with order type $\ell_T(t)$, and $s<_{T}t$ implies $\ell_T(s)<\ell_T(t)$. A cofinal branch is a linearly ordered subset of $T$ meeting every level below $\kappa$.
Then the following are equivalent:
1. $\kappa$ is weakly compact, in the sense that every $\kappa$-tree has a cofinal branch.
2. $\kappa$ is $\Pi^1_1$ indescribable: for every $A \subset V_\kappa$ and every $\Pi^1_1$ sentence $\varphi$ in the second-order language $\{\in,\dot A\}$ with full second-order semantics, if $(V_\kappa,\in,A)\models \varphi$, then there exists an ordinal $\alpha<\kappa$ such that $(V_\alpha,\in,A\cap V_\alpha)\models \varphi^\alpha$, where $\varphi^\alpha$ is obtained from $\varphi$ by restricting first-order quantifiers to $V_\alpha$ and second-order quantifiers to $\mathcal P(V_\alpha)$.