
576 F.3d 522 (2009)
Sarah E. ORYSZAK, Appellant
v.
Mark SULLIVAN, Director, United States Secret Service, Appellee.
No. 08-5403.
United States Court of Appeals, District of Columbia Circuit.
Argued April 17, 2009.
Decided August 14, 2009.
*523 Sheldon I. Cohen argued the cause and filed the briefs for appellant.
Abby C. Wright, Attorney, U.S. Department of Justice, argued the cause for appellee. With her on the brief were Michael F. Hertz, Acting Assistant Attorney General, Jeffrey A. Taylor, U.S. Attorney, and Thomas M. Bondy, Attorney. Joel McElvain, Attorney, entered an appearance.
Before: GINSBURG, ROGERS, and KAVANAUGH, Circuit Judges.[*]
Opinion for the Court filed by Circuit Judge GINSBURG.
Concurring opinion filed by Circuit Judge GINSBURG.
GINSBURG, Circuit Judge:
The United States Secret Service revoked the Top Secret security clearance of Special Agent Sarah E. Oryszak after the agency concluded she had "knowingly passed counterfeit currency." Because having a Top Secret security clearance was a requirement of her job, Oryszak's employment was terminated.
*524 Oryszak does not dispute that she passed counterfeit currency but claims she did not do so knowingly. After exhausting her administrative appeals, she filed this suit under the Administrative Procedure Act, claiming the revocation of her security clearance was arbitrary, capricious, and an abuse of discretion for want of evidence she had passed the currency knowingly.[1] The Government moved to dismiss the complaint for lack of subject matter jurisdiction per FED.R.CIV.P. 12(b)(1) or, in the alternative, for failure to state a claim, per FED.R.CIV.P. 12(b)(6). The district court, concluding the decision was committed to the discretion of the Secret Service, granted the motion to dismiss for lack of subject matter jurisdiction.
Because the facts are not in dispute, we rely upon the account given by the district court. 565 F.Supp.2d at 16-17. We affirm that court's order dismissing Oryszak's complaint, but issue this opinion to clarify that the complaint should be dismissed not for want of subject matter jurisdiction but for failure to state a claim. See EEOC v. St. Francis Xavier Parochial Sch., 117 F.3d 621, 624 (D.C.Cir.1997) ("Although the district court erroneously dismissed the action pursuant to Rule 12(b)(1), we could nonetheless affirm the dismissal if dismissal were otherwise proper based on failure to state a claim under Federal Rule of Civil Procedure 12(b)(6)").

* * *
The district court dismissed the complaint for lack of jurisdiction on the ground that "the Secret Service's decision to revoke Oryszak's security clearance was a decision committed to agency discretion by law," 565 F.Supp.2d at 23, and therefore not subject to the APA. See 5 U.S.C. § 701(a)(2) (providing the APA does not apply to "agency action . . . committed to agency discretion by law"). We agree with the district court that the decision of the Secret Service was committed to agency discretion, although we conclude this is not a jurisdictional bar.
The jurisdiction of the district court did not depend upon the APA, which "is not a jurisdiction-conferring statute." Trudeau v. FTC, 456 F.3d 178, 183 (D.C.Cir.2006); see Califano v. Sanders, 430 U.S. 99, 107, 97 S.Ct. 980, 51 L.Ed.2d 192 (1977) ("[T]he APA does not afford an implied grant of subject-matter jurisdiction permitting federal judicial review of agency action"). Rather, the court had subject-matter jurisdiction pursuant to the so-called "federal question" statute, 28 U.S.C. § 1331, which grants the district *525 court "original jurisdiction of all civil actions arising under the Constitution, laws, or treaties of the United States" and thereby "confer[s] jurisdiction on federal courts to review agency action." Califano, 430 U.S. at 105, 97 S.Ct. 980; see also Chrysler Corp. v. Brown, 441 U.S. 281, 317 n. 47, 99 S.Ct. 1705, 60 L.Ed.2d 208 (1979) ("Jurisdiction to review agency action under the APA is found in 28 U.S.C. § 1331"); Ass'n of Nat'l Advertisers v. FTC, 617 F.2d 611, 619 (D.C.Cir.1979) ("General federal question jurisdiction . . . gives the district courts the power to review agency action absent a preclusion of review statute").
The judicial review provisions of the APA, 5 U.S.C. §§ 701-706, provide "a limited cause of action for parties adversely affected by agency action." Trudeau, 456 F.3d at 185. Because the APA does not apply to agency action committed to agency discretion by law, a plaintiff who challenges such an action cannot state a claim under the APA. Therefore, the court has jurisdiction over his case pursuant to § 1331, but will properly grant a motion to dismiss the complaint for failure to state a claim. See Arbaugh v. Y & H Corp., 546 U.S. 500, 515, 126 S.Ct. 1235, 163 L.Ed.2d 1097 (2006) (limitation on cause of action that "does not speak in jurisdictional terms or refer in any way to the jurisdiction of the district courts" is not jurisdictional).[2]
The Supreme Court has made clear that, at least in the absence of legislation, "the grant of security clearance to a particular employee, a sensitive and inherently discretionary judgment call, is committed by law to the appropriate agency of the Executive Branch." Dep't of the Navy v. Egan, 484 U.S. 518, 527, 108 S.Ct. 818, 98 L.Ed.2d 918 (1988). As Commander in Chief, U.S. CONST., Art. II, § 2, the President has constitutional authority, subject to appropriate limitation by the Congress, "to classify and control access to information bearing on national security and to determine whether an individual is sufficiently trustworthy to occupy a position in the Executive Branch that will give that person access to such information." Id. at 527, 108 S.Ct. 818. The President has delegated that authority to various agencies in the Executive Branch, including the Secret Service. See Exec. Order No. 12,968, 60 Fed.Reg. 40,245 (1995).
Under Egan it falls to the Secret Service to "determine what constitutes an acceptable margin of error in assessing the potential risk" to national security inherent in granting any particular individual access to classified information. 484 U.S. at 529, 108 S.Ct. 818. Here, the Secret Service drew from the undisputed facts an inference about Oryszak's state of mind and made a judgment about her risk to security. As we have stated before, "Egan teaches plainly that review of the breadth of [the margin of error acceptable in assessing the security risk posed by an individual] is outside the authority of a nonexpert body." United States Info. Agency v. Krc, 905 F.2d 389, 395 (1990). Both the aforementioned cases refer to a nonexpert administrative body but the principle applies *526 equally to a court. Therefore, following the lead of the Supreme Court, we have consistently held that because the authority to issue a security clearance is a discretionary function of the Executive Branch, actions based upon denial of security clearance are committed to agency discretion by law, at least where a constitutional claim is not properly presented. See, e.g., Bennett v. Chertoff, 425 F.3d 999, 1001 (D.C.Cir.2005); Ryan v. Reno, 168 F.3d 520, 524 (D.C.Cir.1999); Krc, 905 F.2d at 395.
That a plaintiff complains about an action that is committed to agency discretion by law does not mean his case is not a "civil action[ ] arising under the Constitution, laws, or treaties of the United States." 28 U.S.C. § 1331. It does not mean, therefore, the court lacks subject matter jurisdiction. See Baker v. Carr, 369 U.S. 186, 198, 82 S.Ct. 691, 7 L.Ed.2d 663 (1962). It does mean there is no "law to apply," Citizens to Preserve Overton Park, Inc. v. Volpe, 401 U.S. 402, 410, 91 S.Ct. 814, 28 L.Ed.2d 136 (1971), because the court has "no meaningful standard against which to judge the agency's exercise of discretion." Heckler v. Chaney, 470 U.S. 821, 830, 105 S.Ct. 1649, 84 L.Ed.2d 714 (1985).[3]

* * *
In this case, the APA provides no cause of action to review the decision of the Secret Service to revoke Oryszak's security clearance because that decision is an "agency action . . . committed to agency discretion by law." Therefore Oryszak failed to state a claim upon which relief can be granted, and the order of the district court dismissing Oryszak's complaint must be
Affirmed.
GINSBURG, Circuit Judge, concurring:
We have held that actions based upon denial of security clearance do not merely fail to state a claim, but are beyond the reach of judicial review. See Bennett, 425 F.3d at 1001 ("Because the authority to issue a security clearance is a discretionary function of the Executive Branch and involves the complex area of foreign relations and national security, employment actions based on denial of security clearance are not subject to judicial review"); Ryan, 168 F.3d at 524 (holding "an adverse employment action based on denial or revocation of a security clearance is not actionable under Title VII"); Krc, 905 F.2d at 395.
That a plaintiff makes a claim that is not justiciable because committed to executive discretion does not mean the court lacks subject matter jurisdiction over his case, as the opinion of the court helps to clarify. Upon a proper motion, a court should dismiss the case for failure to state a claim. It follows, however, that a court must decline to adjudicate a nonjusticiable claim even if the defendant does not move to *527 dismiss it under FED. R. CIV. P. 12(b)(6). See Luftig v. McNamara, 373 F.2d 664, 665 (D.C.Cir.1967) (affirming district court's sua sponte dismissal of complaint "on the ground that the relief sought represented a claim for judicial review of political questions"); Mahorner v. Bush, 224 F.Supp.2d 48, 53 (D.D.C.2002) (dismissing sua sponte claims that "present political questions not subject to judicial review").
That the nonjusticiability of a claim may not be waived does not render justiciability a jurisdictional issue, and this court has been careful to distinguish between the two concepts. See, e.g., Joo v. Japan, 413 F.3d 45, 48 (2005) ("[W]e need not resolve the question of the district court's subject-matter jurisdiction . . . before considering whether the complaint presents a nonjusticiable political question"); Public Citizen v. U.S. Dist. Court, 486 F.3d 1342, 1347 (2007) (noting "a federal court may, in appropriate circumstances, dismiss a case on prudential grounds prior to establishing its jurisdiction" and applying the enrolled bill rule); In re Papandreou, 139 F.3d 247, 255 (D.C.Cir.1998) ("[A]lthough subject-matter jurisdiction is special for many purposes. . . a court [may instead] dismiss[] on other non-merits grounds such as forum non conveniens"); see also Tenet v. Doe, 544 U.S. 1, 6 n. 4, 125 S.Ct. 1230, 161 L.Ed.2d 82 (2005) (holding the Totten rule requiring dismissal on the ground of public policy, "like the abstention doctrine . . . or the prudential standing doctrine, represents the sort of `threshold question' we have recognized may be resolved before addressing jurisdiction") (internal citation omitted).
That the court may in its discretion address a threshold question before establishing that it has jurisdiction does not render the question jurisdictional nor, significantly, does it mean the court must address that question at the outset of the case. Because justiciability is not jurisdictional, a court need not necessarily resolve it before addressing the merits. A court may, for example, dismiss a case for failure to state a claim while reserving the question whether that sort of claim presents a nonjusticiable political question. A court might thereby avoid a constitutional ruling regarding separation of powers and resolve the case upon a solely statutory basis. See generally Escambia County v. McMillan, 466 U.S. 48, 51, 104 S.Ct. 1577, 80 L.Ed.2d 36 (1984) ("It is a well-established principle governing the prudent exercise of this Court's jurisdiction that normally the Court will not decide a constitutional question if there is some other ground upon which to dispose of the case"). For a court to retain this discretion it is important to distinguish among failure to state a claim, a claim that is not justiciable, and a claim over which the court lacks subject matter jurisdiction.
We have not always been consistent in maintaining these distinctions. See, e.g., Bancoult v. McNamara, 445 F.3d 427, 432 (D.C.Cir.2006) (treating the political question doctrine as jurisdictional). For that reason, I urge the en banc court to clarify the relationship of justiciability to jurisdiction when an appropriate case arises.
NOTES
[*]  Circuit Judge KAVANAUGH concurs in all but footnote 3 of the opinion of the court.
[1]  Oryszak maintains she also brought a constitutional claim for deprivation of liberty and property interests without due process of law, but she did not sufficiently raise that claim in her complaint or otherwise give the district court notice thereof. See 565 F.Supp.2d 14, 19 n. 1 (2008) ("Oryszak does not make any constitutional claims here"). Oryszak points out that, in support of her prayer for injunctive relief, she alleged irreparable harm because she is unable to get work that requires a security clearance. Even if that allegation had not appeared under the heading "Violation of the APA," it would still have been too obscure a hint to have put the court on notice of a constitutional claim; so too with the observation en passant in her opposition to summary judgment that even a broadly drawn statute "does not exclude a review of a colorable constitutional claim," her argument there being that revocation of a security clearance is not an act "committed to agency discretion by law" within the exclusion from judicial review in APA § 10, 5 U.S.C. § 701(a)(2). See Greenhill v. Spellings, 482 F.3d 569, 573 (D.C.Cir.2007) ("nothing in our case law requires a district court to go on a fishing expedition for new claims"). Accordingly, we will not consider Oryszak's constitutional claim in this appeal. See Ranger Cellular v. FCC, 333 F.3d 255, 261 (D.C.Cir.2003) ("We do not ordinarily consider an argument made for the first time on review").
[2]  Recently we clarified that the provision of the APA limiting judicial review to "final agency action," 5 U.S.C. § 704, goes not to whether the court has jurisdiction but to whether the plaintiff has a cause of action, though some prior opinions had "loosely referred to the final agency action requirement as `jurisdictional.'" Trudeau, 456 F.3d at 184; cf. Arbaugh, 546 U.S. at 510, 126 S.Ct. 1235 ("`Jurisdiction . . . is a word of many, too many, meanings.' This Court, no less than other courts, has sometimes been profligate in its use of the term.") (internal citation omitted). That clarification applies with equal force to § 701(a)(2), which, like § 704, limits the cause of action provided by the APA.
[3]  The source of confusion upon this point may be in part that § 701(a)(2) codifies "traditional principles of nonreviewability," Sec'y of Labor v. Twentymile Coal Co., 456 F.3d 151, 160 (D.C.Cir.2006), according to which a matter committed to agency discretion is not reviewable because courts lack judicially manageable standards by which to evaluate it. Drake v. FAA, 291 F.3d 59, 70 (D.C.Cir.2002). That a particular dispute is nonjusticiable, however, does not mean the court lacks jurisdiction over the subject matter. See Baker, 369 U.S. at 198, 82 S.Ct. 691 ("The distinction between the two grounds is significant. In the instance of nonjusticiability, consideration of the cause is not wholly and immediately foreclosed; rather, the Court's inquiry necessarily proceeds to the point of deciding whether the duty asserted can be judicially identified and its breach judicially determined, and whether protection for the right asserted can be judicially molded").
